write a program I java to print the square of the numbers from 1 to 10 also print the sum of it
Answers
Answered by
0
Answer:
Input : N = 4
Output : 30
12 + 22 + 32 + 42
= 1 + 4 + 9 + 16
= 30
Iput : N = 5
Output : 55
Answered by
3
Answer:
public class calculate{
public static void main(String args[])
{
int sum=0;
for(int i=1;i<=10;i++)
{
sum+=i;
System.out.println(i+"^2="+(i*i));
}
System.out.println("sum="+sum);
}
}
Explanation:
Please mark me as brainliest!
Similar questions
Math,
4 months ago
Physics,
9 months ago
English,
9 months ago
Social Sciences,
1 year ago
Physics,
1 year ago