void main()
{
int i,fact=1,num;
clrscr();
printf("\nenter a number ");
scanf("%d",&num);
if(num==0)printf("\nfactorial is 1");
else
{
for(i=1;i<num;i++) fact=fact*i;
printf("\nthe factoral is %d",fact);
}
getch();
}
This blog has been created especially for students who are looking for solutions to simple C/C++/java programs that are usually asked at school/college level. Feel free to query or notify us about any errors.
E-mail us at prgms4starters@gmail.com for any queries or to share your programs. Please mention the program definition in the subject line.
In case you need help in finishing a program, do mention "incomplete pgm" in the subject line. Our team of experts will do their best to help you.
Click the link to follow this page for updates and reminders: FOLLOW THIS SITE
You can also visit our Facebook page by clicking HERE
**don't forget to participate in the polls at the bottom of the page
No comments:
Post a Comment