Predict the output for the question.
Attachments:
Answers
Answered by
3
Required Answer:-
Question:
- Predict the output of the given program.
Answer:
The output of the given program is,
1
4
9
16
25
36
47
64
81
100
Explanation:
Given códe snippet,
for(int i=1,j=1 ; i<=10 ; i++,j++) {
System.out.println(i*j);
}
Initially,
- i = 1 and,
- j = 1
The above códe iterates the loop if i<=10 is true.
After each iteration, the program displays the value of i*j. As i = j, so it prints square of all the numbers from 1 to 10.
Answered by
25
1
4
9
16
25
36
49
64
81
100
Therefore 100 will be the answer
Similar questions
Biology,
2 months ago
Environmental Sciences,
2 months ago
Math,
4 months ago
Hindi,
10 months ago
Math,
10 months ago
Accountancy,
10 months ago