Series 17
2!+4!+6!+8!+10!+..........upto n terms.
import java.util.*;
class Series19
{
public static void main(String args[])
throws InputMismatchException{
Scanner scan=new Scanner(System.in);
System.out.println("Enter the limit: ");
int n = scan.nextInt();
int i, j, f, p=2, s=0;
for(i=0;i < n; i++){
f = 1;
for(j=1;j<=p;j++)
f = f*j;
s = s + f;
p = p + 2;
}
System.out.println("Sum = "+s);
}//end of main
}//end of class
Have something to say? Log in to comment on this post.
0 comments