Answer to Question #1257 in C++ for umar

Question #1257
Print a table of any number inputted by user using while loop in C++.
1
Expert's answer
2011-01-10T15:51:51-0500
#include <iostream>

using namespace std;

int main() {
int number;

cout<<"Please input any number"<<endl;
cin>> number;
while (number >= 0) {
 cout<<number<<endl;
 number -= 1;
}
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
APPROVED BY CLIENTS