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 are type modifiers in c?
What are global variables?
i have to apply for the rbi for the post of officers. i need to know abt the entrance questions whether it may be aps or techinical....
What is the size of enum in bytes?
the number of measuring units from a arbitrary starting point in a record area or control block to some other point a) branching b) recording pointer c) none d) offset
what is difference between array,strutter,union and pointers
3 Answers CTS, Lovely Professional University, Mannar Company,
write a program using linked list in which each node consists of following information. Name[30] Branch Rollno Telephone no i) Write the program to add information of students in linked list
Explain enumerated types in c language?
What are the advantages of union?
What is bss in c?
64/square(4)
Why clrscr is used in c?