Computer Science, asked by anmolmahajan3405, 7 months ago

Write a program to nd the sum of the following series i.x + x2 + x3 + x4 ......... x10
ii5 + 10 + 15 + 20 ........ 100

Answers

Answered by dhruvgupta9371
1

Answer:

class series

{

void main(x)

{

int pro=0;int i =1;

while(i<=10)

{

pro=pro+(sum*i);

i+=1;

}

System.out.println(""Result of series=""+pro);

}

}

class series2

{

void main()

{

int sum=0;int i =5;

while(i<=100)

{

sum=sum+i;

i+=5;

}

System.out.println(""Result of series=""+sum);

}

}

Similar questions