Computer Programming...
Lets have fun with the concepts and coding of programs in C/C++ and Java.
Saturday, 25 February 2012
No Argument No Returning type function program
#include<stdio.h>
#include<conio.h>
void fact();
void main()
{
clrscr();
fact();
getch();
}
void fact()
{
int i=0,f=1,n;
printf("Enter the number: ");
scanf("%d",&n);
for(i=n;i>0;i--)
f=f*i;
printf("\nThe factorial of the number is: %d",f);
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment