free c programming course
Friday, 19 August 2011
Factorial off a number using "do while" loop
#include<stdio.h>
#include<conio.h>
void main()
{
int n,f=1;
clrscr();
printf("enter any number=");
scanf("%d",&n);
do
{
f=f*n;
n--;
}
while(n>0);
printf("factorial number is=%d",f);
getch();
}
Courtesy: Ashish Garg
Patiala, India
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment