Answer to Question #24166 in C++ for mike nelson

Question #24166
ask user for a number greater than 100 if the user doesn't follow firections display an error if the number is greater than 200 multiply it by itself and display "your number squared is ##" 50 times on 50 different line
1
Expert's answer
2013-02-13T11:23:27-0500
#include <conio.h>
#include <iostream>

using namespace std;

int main()
{
int number;
cout << " Enter a number greater than 100: ";
cin >> number;

if (number < 100)
cout << " Wrong number.";
else if (number > 200)
{
number *= number;
for (char c = 0; c < 50; c++)
cout << " Your number squared is " << number << endl;
}
_getch();
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
APPROVED BY CLIENTS