What's New-Given Below
technicalsymposium
technicalsymposium
technicalsymposium

Free E-Mail Alerts

C/C++ Lab Program(s)/Materials

C Program for factorial using recursion.

#include<stdio.h>
#include<conio.h>
int fact(int);
void main()
{
int a,b=0,c;
clrscr();
printf("Enter the N value:");
scanf("%d",&a);
while(a<0)
{printf("\n\Enter only positive number.\n");
printf("Enter N value:");
scanf("%d",&a);
}
b=fact(a);
printf("%d",b);
getch();
}
int fact(int x)
{
if(x==0)
{
return(1);
}
else
{
return((x)*(fact(x-1)));
}
}

technical symposium

Technicalsymposium.com-Latest Updates
Fresher’s Jobs/Symposium/Education Updates-Click below

Subscribe for Free E-Mail Alerts-Click below
technical symposium

Hosting by Yahoo!

About-Us    Contact-Us    Site-map

©copyright 2009 All rights are reserved to technicalsymposium.com