Welcome to ICSE Java Answers. Ask any questions you have related to Java and we will answer them.
Java is a registered trademark of Oracle. This site is in no way related to or endorsed by Oracle.

Write a program in java to fing the sum of given series.

0 votes
1/2 + 2/3 + 3/4 +................ + 19/20
asked by anonymous

1 Answer

0 votes
class SumOfSeries
{
 public static void main(String[ ] args)
 {
   double s=0.0;
   for(int i=1; i<=19; i++)
   {
     s=s+(double)i/(i+1);
    }
    System.out.println("Sum of Series:"+s);
  }
}
answered by Programmer (25 points)
...