C programme to find FACTORIAL number without using function
/*read user number and power and print result*/
#include<stdio.h>
#include<conio.h>
int main()
{
int p;
float n,r=1;
printf("enter a number : ");
scanf("%f",&n);
printf("\n enter the power : ");
scanf("%d",&p);
while(p>0)
{
r=r*n;
p--;
}
printf("RESULR = %g",r);
return 0;
}
0 Comments