write a programe to find the factorial of given number
using recursion

Answers were Sorted based on User's Feedback



write a programe to find the factorial of given number using recursion..

Answer / hari

int 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 ?    13 Yes 4 No

write a programe to find the factorial of given number using recursion..

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

write a programe to find the factorial of given number using recursion..

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

Post New Answer

More C Interview Questions

What are type modifiers in c?

0 Answers  


What are global variables?

0 Answers  


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....

0 Answers   RBI,


What is the size of enum in bytes?

0 Answers  


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

0 Answers  






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

0 Answers   Persistent,


Explain enumerated types in c language?

0 Answers  


What are the advantages of union?

0 Answers  


What is bss in c?

0 Answers  


64/square(4)

1 Answers  


Why clrscr is used in c?

0 Answers  


Categories