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

  • 464 views
Uploaded on

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

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

More in: Education
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
464
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
1
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 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. Output :-