/* function prototype */
# include <stdio.h>
int fact (int) ;
void main ()
{
int a,b ;
clrscr () ;
printf ("\n enter the value of a:") ;
scanf ("%d", & a) ;
b = factorial(a) ;
getch () ;
}
int factorial (int a)
{
int fact = 1 ;
while (a!=0)
{
fact=fact*a ;
a-- ;
}
getch ;
}
# include <stdio.h>
int fact (int) ;
void main ()
{
int a,b ;
clrscr () ;
printf ("\n enter the value of a:") ;
scanf ("%d", & a) ;
b = factorial(a) ;
getch () ;
}
int factorial (int a)
{
int fact = 1 ;
while (a!=0)
{
fact=fact*a ;
a-- ;
}
getch ;
}
No comments:
Post a Comment