import java.util.Scanner;
public class series2
{
public static void main(String[] args)
{
double sum = 0;
int n;
System.out.println("1/1! + 2/2! + 3/3! + ..N/N!");
Scanner sc = new Scanner(System.in);
System.out.print("Enter the no.of terms in series:");
n = sc.nextInt();
Sum obj = new Sum();
for(int i = 1; i <= n; i++)
{
sum = sum + (double)i / (obj.(i));
}
System.out.println("Sum of series:"+sum);
}
int fact(int x)
{
int mul = 1;
while(x > 0)
{
mul = mul * x;
x--;
}
return mul;
}
}
can anybody please tell me what is wrong in this?
this is a java program
Answers
Answered by
0
Answer:
don't know .............
Similar questions