WAP to find out sum of the following series 100+98+96+………+50 in java
1. //Ques. 2
WAP to find out sum of the following series
100+98+96+………+50
class sum
{
public static void main(String arg[])
{
inti=100,s=0;
while(i>=50)
{
s=s+i;
i=i-2;
}
System.out.println("n SUM of ( 100+98+96+........50 )");
System.out.println("n sum is : "+s);
}
}