How to write a “do while” loop that inputs a num which must be between 10-20. (Pic has all instructions)
![How to write a do while loop that inputs a num which must be between 1020 Pic has all instructions class=](https://us-static.z-dn.net/files/d6d/bae6489682c24d6d05149d541abf4a4b.png)
Answer:
# include <iostream>
using namespace::std;
int main()
{
int num;
do
{
cout<<"Enter number:";
cin>> num;
} while(num<=20 && num >=10);
cout<<"You entered out of range";
return 0;
}
Explanation:
Please find the required program in the answer section. And you should know that a do-while loop is used when we want to make sure that the loop runs for at least one time.