Write a Java Programming:-
Print the given output : 2 6 12 20 30 42 56 72 90 110
Answers
Answered by
1
Answer:
feeling proud Indian army
Answered by
2
Answer:
public class Display_4
{
public static void main(String[]args){
int i,c;
for(i=1;i<=10;i=i+1)
{ c=i*i+i;
System.out.print(c+" ");
}
}
}
Explanation:
1*1+1= 2
2*2+2= 6
3*3+3= 12
4*4+4= 20
5*5+5= 30
6*6+6= 42
7*7+7= 56
8*8+8= 72
9*9+9= 90
10*10+10= 110
It is a simple loop 1 to 10 where the processing is done and stored in the variable c. After that c is printed.
Attachments:
Similar questions
Math,
3 months ago
Physics,
3 months ago
Environmental Sciences,
7 months ago
Math,
11 months ago
English,
11 months ago