Tuesday, December 30, 2014

C program to find factorial using Recursion

/*C program to find factorial using Recursion*/


#include<stdio.h>
#include<conio.h>
int fact(int);
int main()
{
int num,f;
printf("\nEnter a number: ");
scanf("%d",&num);
f=fact(num);
printf("\nFactorial of %d is: %d",num,f);
return 0;
}
int fact(int n)
{
if(n==1)
return 1;
else
return(n*fact(n-1));
}

2 comments:

  1. gioco digitale - StillCasino
    gioco digitale. sbobet ทางเข้า Goto, Inc. logo, 11bet logo, gio, gio, gio, gioco digitale gio, gio, gio. gio logo. gio, casino, gio, gio.

    ReplyDelete
  2. Casinos in the UK - How to find good games - GrizzGo
    So, gri-go.com what 바카라 사이트 do we mean by “casinos bsjeon.net in the UK”? nba매니아 to find a casino and live casino games on goyangfc a mobile phone device in 2021.

    ReplyDelete