This page contains self developed programs that surely runs to execution without flaws. I upload my programs as and when I develop it for my lab assignments. If any of the programs have bugs please leave a comment so that I can debug it, which would be helpful for others!
Thank You for visiting my blog Gentleman / Madam!
Monday, June 13, 2011
Factorial
#include<stdio.h> #include<conio.h> void main() { int n,fac =1,i; printf("Enter the number for which the factorial is to be found :") ; scanf("%d",&n); for (i=1;i<=n;i++) fac*=i; printf("The factorial of %d is %d",n,fac); getch(); }
No comments:
Post a Comment