News-Buddhism
Tuesday, July 5, 2011
โปรแกรมการหา Factorial
#include <stdio.h>
void main()
{
int count;
int fac;
int ans =1;
printf("Please Enter number: ");
scanf("%d",&fac);
count = fac;
while(count>0)
{
ans = ans*count;
count--;
}
printf("%d! = %d\n",fac,ans);
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment