Hello I need help figuring out how to write a loop program that behaves a certain way, I have been beating my head off of walls trying to figure this out and it is probaby so easy..

This is the expected behaviour:

$ ./a.out

Enter some text on 1 or more lines followed by &.

1 25
cat
0g 6&

there were 9 (non-whitespace) characters before the &
5 of them were digits
&

Did you try something? Any codes?

I do not even know where to start. I know that I am supposed to be using a loop, a while statement. I have not learned anything about strings or arrays yet so I am just dumbfounded as to how I am supposed to write this.... any help would be so much appreciated

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.