Saturday, 25 February 2012

No Argument No Returning type function program


#include<stdio.h>
#include<conio.h>
void fact();
void main()
{
clrscr();
fact();
getch();
}


void fact()
{
int i=0,f=1,n;
printf("Enter the number: ");
scanf("%d",&n);
for(i=n;i>0;i--)
f=f*i;
printf("\nThe factorial of the number is: %d",f);
}

No comments:

Post a Comment