76 964
Assignments Done
98,5%
Successfully Done
In June 2019

Answer to Question #47623 in C++ for jhulliused

Question #47623
a C++ program that uses a iteration statement to generate the square of a number
Expert's answer
Code
#include <iostream>
#include <iomanip>
#define MAX 10

using namespace std;

int main() {
for (int i = 1; i <= MAX; i++) {
cout << i << "^2:" << "\t" << i * i << endl;
}

return 0;
}
Result
1^2: 1
2^2: 4
3^2: 9
4^2: 16
5^2: 25
6^2: 36
7^2: 49
8^2: 64
9^2: 81
10^2: 100

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 first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions