April 14th, 2003, 01:12 AM
Join Date: Feb 2001
Time spent in forums: 18 h 20 m 28 sec
Reputation Power: 14
Do you know how to get input from the user?
An array is essentially the same thing as number_a, number_b, and number_c. The line:
declares three variables of type int: number, number, and number. Why are arrays useful? What if you had 1,000 numbers to read in from the user. Without arrays, you would have to input the numbers like above, which would require you to type 1,000 cin statements. With arrays you can do this:
for(int i=0; i<1000; i++)
cout<<"Enter data "<<i<<": ";
Isn't that a lot easier?
Last edited by 7stud : April 14th, 2003 at 01:24 AM.