Computer Science, asked by SanidhyaPurbey, 11 months ago

can anyone print this series in java program using blue j....​

Attachments:

Answers

Answered by Anonymous
0

hey mate

here is your solution.....

import java.util.*;

class Sum_series

{

public static void main (String args [])

{

Scanner sc =new Scanner (System.in);

System.out.println("enter the value of n");

int n=sc.nextInt();

int S=0;

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

{

int f=1;

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

{

f*=j;

}

if(i%2==1)

S=S+i/f;

else

S=S-1/f;

}

System.out.println("Sum series:"+S);

}

}

LIKE AS MUCH AS YOU CAN!!!!

Similar questions