Computer Science, asked by sanchi2003, 1 year ago

please solve the following program in java scanner class

Attachments:

PrinceJK786: hiii
PrinceJK786: hey
PrinceJK786: hello

Answers

Answered by mn121
1

this of dn publisher book....

import java.util.*;

public class sum

{

   public static void main(String args[])

   {

       Scanner in = new Scanner(System.in);

       int x,n,i,j,f;

       double s=0.0;

       System.out.println("Enter the limit and the value of 'x' = ");

       n= in.nextInt();

       x=in.nextInt();

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

       {

           f=1;

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

           {

             f=f*j;

           }

           s=s+((((i-1)*x)+i)/(f*1.0));

       }

       System.out.print("Sum = "+s);

   }

}


mn121: please mark it as brainliest...
sanchi2003: someone else has not written answers
sanchi2003: BTW thanks a lot.... ♥
mn121: ur wlcm ... and no problem...
Answered by Lazarus
0

Answer:

import java.io.*;. //Scanner package name for java input,output and utility

import java.util.*;

class factorial //Class name//

{

public static void main(int x,int n)

{

Scanner Sc=new Scanner(System.in);

System.out.println("Enter the number of terms in the series:"); //Scanner name to initialise variables

n=Sc.nextInt();

int s=1;int f=1;int g=2;

for(int i=1; i less than equal to n;i++)

{

s=s+(i*x+(i++))/f*g;

g++;. //Loop iteration to find out the sum of the series

}

System.out.print("\n");

System.out.println("Sum of series are="+s);. //To display the sum//

}

}

Similar questions