Computer Science, asked by rishikamalani83, 8 months ago

Write a program to find the sum of the following series:

S=10+20+40+70+110+………….N terms.​

Answers

Answered by jk0336154
0

important java. util. *;

class p1

{

public static void main(String [] args)

{

Scanner in = new Scanner(System.in);

double n=0;

System. out. println("Enter the value of n ") ;

n=in.nextDouble() ;

int I,s;

s=0;

for(I=10;i<=n;I=I+10)

{

s=s+i;

}

System. out. println(" The value of s = " +s) ;

}

}

Hope It Helps!!!!

Please mark brainliest and rate it if you find it useful

Similar questions