Page

Monday, 27 August 2018

program of factorial

#include<iostream.h>
#include<conio.h>
int main()
{
clrscr();
int i, num, fact = 1;
cout<<"enter integer:";
cin>>num;
i=num;
while(num)
{
fact*=num;
    --num;
}
cout<<"the factorial of:"<<i<<"is:"<<fact<<"\n";
getch();
return(0);
}

   


No comments:

Post a Comment