DESCRIPTION-:THIS PROGRAM FINDS THE FACTORIAL OF THE GIVEN NUMBER
PROGRAM-:
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int i,n,fact=1;
cout<<"enter the no. whose factorial is to be find";
cin>>n;
for(i=1;i<=n;i++)
{
fact=fact*i;
}
cout<<"factorial of number is"<<fact;
getch();
}
PROGRAM-:
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int i,n,fact=1;
cout<<"enter the no. whose factorial is to be find";
cin>>n;
for(i=1;i<=n;i++)
{
fact=fact*i;
}
cout<<"factorial of number is"<<fact;
getch();
}
0 comments:
Post a Comment