Counting Integers: Writing a Program

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
3 replies · 3K views
Gumbyboy2006
Messages
1
Reaction score
0
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.
 
Physics news on Phys.org