Computer Science, asked by priya2004, 1 year ago

write a program to print S is equals to 10 + 1 + 9 + 2 + 8 + 3 + 7 + 4 + 6 + 5 + 5 + 6 + 4 + 7 + 3 + 1 + 2 + 9 + 1 + 10

Answers

Answered by amannishad0512p5zxh6
0

class Sum

{

public static void main()

{

int i=0,S=0,n=10;

while(n!=0)

{

S+=n+i;

i++;

n- -;

}

System.out.println("Sum of series "+S);

}

}

Hope it will help priyaji@

Bohtt hard

Similar questions
Math, 1 year ago