Chapter 5 : Functions & Pointers (Let us C) Get link Facebook X Pinterest Email Other Apps - June 22, 2018 Write a function to calculate the factorial value of any integerentered through the keyboard. #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=3333!=-2147483648 Get link Facebook X Pinterest Email Other Apps Comments
Comments
Post a Comment