(1+2)/(1*2) + (1+2+3)/(1*2*3) + ........ + (1+2+3+ .... + n)/(1*2*3* .... * n)
i have written the code as follows but there is error in my formula
public class Series
{
public static void main(int n)
{
int i;
double s=0;
for(i=1;i<=n;i++)
s=s+(double)(i+(i+1))/(i*(i+1));
System.out.println("Sum = "+s);
}
}


Sign In
Create Account


Back to top









