Computer Science, asked by sunitazirange, 9 months ago

Write a java program to find the series and also print the value of S . S=1/2+1/3+1/4+1/5+1/6+1/7+1/8+1/9+1/10+1/11+1/12+1.13+1/14+1/15
= 2.31822899323
we have to print the value of 'S' like above and also print these series

Answers

Answered by Anonymous
9

Explanation:

class Sum_series

{

public static void main(String args[])

{

double sum=0;

System.out.print("S=");

for(int i=1;i<=15;i++)

{

System.out.print("1/"+i+"+");

sum=1.0/i+s;

}

System.out.print("\b"+"="+s);

}

}

Similar questions