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

734 views
641 views

Published on

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

Published in: Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
734
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

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 :-

×