How to write program 1- 1/3+1/4+1/5......n Get link Facebook X Pinterest Email Other Apps - March 16, 2021 double a=4.0,sum=0.0; // take third term as "a"int n=10; for(i=1 ;i<=n-2;i++){sum=sum + 1/a;a++}System.out.prtinln(1- 1.0/3+sum); Get link Facebook X Pinterest Email Other Apps Comments Unknown16 March 2021 at 13:02Sir jii Aap bhi OP...!!ReplyDeleteRepliesReplyAdd commentLoad more... Post a Comment
How to print 9,99,8,89,7,79.... - March 16, 2021 / common way to write int a=9,n=10 ; // n value you can take anything for(int i=1;i<=n;i++) { if(i%2==1) { System.out.print(a); } else { System.out..print(a*10+9); a--; }} Read more
print the series 2+4+6+8+...n using java - April 01, 2021 int a=2,n=10; // n for number of terms //a is the starting value int sum=0; for(int i=1;i<=n;i++) { sum=sum+a; a=a+2; } System.out.println(sum); Read more
Sir jii Aap bhi OP...!!
ReplyDelete