Answers

2014-06-21T00:31:48+05:30
//To find the factorial of 10 using do-while statement.
public class factorial
{
public static void main(String args[])
{
int i,f ;i=1;f=1;
do
{
f=f * i ;
i++
}
while(i<=10);
System.out.println("The factorial of 10 = "+f);
}
}

*************************HOPING THAT THIS WILL HELP YOU!!!**********************
1 5 1
Plz mark it as best!!!............... : )
2014-06-25T01:13:02+05:30
Import java.io.*;
class fact
{
int fac(int a)
{
if(a=0)
return(1);
else
return(n*fac(n-1));
}
public static void main(String args[])
{
int b;
InputStreamReader read=new InputStreamReader(System.in);
BufferedReader in=new BufferedReader(read) ;
System.out.println("Enter the number");
b=Integer.parseInt(in.readLine());
fact ob=new fact;
ob.fac(b);
}
}
hope i helped u:)
1 1 1