write a programe to find the factorial of given number
using recursion
Answers were Sorted based on User's Feedback
Answer / hari.11
t fact(int n)
{
if(n==1)
return 1;
else
return(n*fact(n-1));
}
for further queries and discussions, just check these out !!!
http://forum.campusmaniac.com/
http://www.campusmaniac.com/
Is This Answer Correct ? | 2 Yes | 2 No |
Answer / jessie
import util.java.Scanner
class factorial
{
public static void main(string arge[])
{
Scanner s=new Scanner(System.in);
int n=new int();
n=s.nextInt();
fact(n);
fact(int n)
{
if(n==1)
return 1;
else
return (n*fact(n-1));
}
System.out.println("the factorial of number is "+n);
}
}
Is This Answer Correct ? | 1 Yes | 2 No |
What's the difference between a linked list and an array?
can you change name of main()?how?
What is non linear data structure in c?
Is c language still used?
plz let me know how to become a telecom protocol tester. thank you.
What do you mean by c what are the main characteristics of c language?
write a c/c++ programthat connects to a MYSQL server and checks if the INNoDB plug in is installed on it.If so your program should print the total number of disk writes by MYSQL.
how can i sort numbers from ascending order and descending order using turbo c..
What is the significance of an algorithm to C programming?
What is volatile variable in c?
How will you declare an array of three function pointers where each function receives two ints and returns a float?
Describe the header file and its usage in c programming?