Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
//Ques. 2

WAP to find out sum of the following series

100+98+96+………+50
class sum
{
public static void main(String arg[])...
Output :-
Upcoming SlideShare
Loading in …5
×

WAP to find out sum of the following series 100+98+96+………+50 in java

800 views

Published on

WAP to find out sum of the following series 100+98+96+………+50 in java

Published in: Education
  • Be the first to comment

  • Be the first to like this

WAP to find out sum of the following series 100+98+96+………+50 in java

  1. 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); } }
  2. 2. Output :-

×