SOLVE THIS JAVA PROGRAMMING PLEASE
Attachments:
Sumanmi:
are you from odisha?
Answers
Answered by
2
Java is a machine independent language which can work on any platform. Its an object oriented programming which stress on object rather than data.
The main parts while doing Java programming are package, Class ,input variables, condition updating.
import java. util. *;
class choice
{
public int factorial(int n)
{
int i,f=1;
for(i=1;i<=n; i++)
{
f=f*i;
}
return(f);
}
public void call()
{
double s:
int k, l, p :
for(k=1 ;k<=10 ;k++)
{
p=1;
for(l=1 ;l<=10 ;l++)
{
p=p*l;
}
s=s+1/p;
}
System . out . println("The sum of series is"+s);
}
public static void main(String args[])
{
int a, b;
Scanner Sc=new Scanner(System . in);
System . out . println("Enter any number");
a=Sc . nextInt();
choice obj=new choice();
b=obj . factorial(a);
System . out . println("Factorial of number is"+b);
obj. call();
}
}
Similar questions