Answer to Question #148416 in C++ for Gerald

Question #148416
Make a program that will input water level percentage, while the water level did not reach
into its critical level which is 50 percent, Display the water level and minus it by 10 percent in
every loop. Use while loop.
1
Expert's answer
2020-12-03T07:27:49-0500
#include <iostream>

using namespace std;

int main()
{
    int level;
    level = 0;
    while(level<50){
    cout<<"Input level in %:";
    cin >> level;
}
    while(level>0){
    cout<<"Current level is "<< level << "% \n";
    level = level - 10;   
    }
    cout<<"Empty!";
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog