Using a Sentinel Value to Control a while Loop
In this exercise, you use what you have learned about sentinel values. Study the following code, and then answer Questions.
int numToPrint, counter;cout ≪ "How many pages do you want to print? ";cin >> numToPrint;counter = 1;while(counter <= numToPrint);{cout ≪ "Page Number " ≪ counter ≪ endl;counter++;}cout ≪ "Value of counter is " ≪ counter ≪ endl;What is the output if the user enters a 3?
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.