AREA OF TRIANGLE
#include<stdio.h>
#include<conio.h>
int fact(int);
int b,p;
void main()
{
printf("enter a number\n");
scanf("%d",&b);
fact(b);
printf("factorial of %d is %d",b,p);
getch();
}
int fact(int b)
{
if(b==0)
return(1);
else
p=b*fact(b-1);
return(p);
}
#include<stdio.h>
#include<conio.h>
int fact(int);
int b,p;
void main()
{
printf("enter a number\n");
scanf("%d",&b);
fact(b);
printf("factorial of %d is %d",b,p);
getch();
}
int fact(int b)
{
if(b==0)
return(1);
else
p=b*fact(b-1);
return(p);
}
No comments:
Post a Comment