Chapter 5 : Functions & Pointers (Let us C)

#include <stdio.h>
main()
{
int a, f;
printf("enter any number=");
scanf("%d",&a);
f=fact(a);
printf("%d!=%d",a,f);
}
fact(int x)
{
int i,f=1;
for(i=x;i>=1;i--)
{
f=f*i;
}
}

Output:


enter any number=33
33!=-2147483648


Comments

Popular posts from this blog

Given the coordinates (x, y) of a center of a circle and it’s radius, write a program which will determine whether a point lies inside the circle, on the circle or outside the circle.

g