
Patrick B. answered 01/12/20
Math and computer tutor/teacher
As long as an integer is correctly input, the while loop will run forever...
scanf returns the number vars that correctly match the format string, hence formatted..
since a single integer is being input, as long as an integer value is input, the loop will continue...
So for example, if the user inputs 5 integers and then a string, the loop will execute 5 times
and fail on the 6th. In this case i=5
If for example, the user inputs 100 integer values and then a string, the loop will execute 100
times and fail of the 101st. In this case i=100
Therefore, the value of i will be the number of integers input by the user;
the integer that is input will be displayed each time through the loop...
finally the value of I is output