View Full Version : C++ Code Help
Gumbyboy2006
Jul25-06, 11:35 AM
How I can write a program which reads a sequence of integers and counts how many there are. Print the count. For example, with input 55 25 1004 4 -6 55 0 55, the output should be 8 because there were eight numbers in the input stream. Please help.
0rthodontist
Jul25-06, 12:10 PM
Can you write a program that just reads integers until there aren't any more, then stops?
Use a while loop, the cin.eof() function, and a counter variable.
- Warren
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.