ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   SiteMap shows list of All Categories in this site.
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
write a program that finds the factorial of a number using
recursion?
 Question Submitted By :: A. Sujatha
I also faced this Question!!     Rank Answer Posted By  
 
  Re: write a program that finds the factorial of a number using recursion?
Answer
# 1
#include<stdio.h>
#include<conio.h>
void main()
{
int factorial(int);
int n;
clrscr();
printf("Enter a number: ");
scanf("%d",&n);
printf("Factorial of %d is: %d",n,factorial(n));
getch();
}
int factorial(int f)
{
int fact;
if(f==1)
 return(1);
else
 fact=f*factorial(f-1);
return(fact);
}
 
Is This Answer Correct ?    6 Yes 0 No
Anandi
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
what is the differance between pass by reference and pass by value. Infosys4
whether itis a structured language? Microsoft1
What's the difference between calloc() and malloc()?  3
C,c++, Java is all are structural oriented or procedure oriented language..?  3
#include<stdio.h> main() { char s1[]="Ramco"; char s2[]="Systems"; s1=s2; printf("%s",s1); } what will happen if you executed this code? Ramco4
pgm in c to reverse string by word using array(god is love becomes love is god) (no additional array can used,space is only delimiter between words ) Persistent1
what is the diff b/w static and non static variables in C. Give some examples plz. Wipro2
Which of the following is not an infinite loop ? a.while(1){ .... } b.for(;;){ ... } c.x=0; do{ /*x unaltered within theloop*/ ... }while(x==0); d.# define TRUE 0 ... while(TRUE){ .... } TCS4
YBJBU6  1
CAN WE DEFINE ANY FUNCTION WITHIN A FUNCTION.  6
Give a fast way to multiply a number by 7 Microsoft8
what is the hexidecimal number of 4100? Google14
without using arithmatic operator solve which number is greater??????????  1
Reverse a string word by word??  6
write a c programs to do multiplication of two numbers with out using arithmatic operator ?????????? TCS4
why division operator not work in case of float constant?  1
Why does not use getgh(); and <conio.h> in c language. Elofic2
what is real time system?what is the differance between hard and soft real time systems  2
1.write a program to merge the arrays 2.write efficient code for extracting unique elements from a sorted list of array? Qualcomm2
Write a program to interchange two variables without using the third variable? Accenture11
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com