Write a program that will print the factorial of any number.
input : 5
Output : 5 x 4 x 3 x 2 x 1 = 120
PROGRAM:
#include <iostream.h>
#include <conio.h>
void main() {
clrscr();
long int fact=1;
int num;
cout<<"Enter the number to generate factorial: ";
cin>>num;
while(num>0) {
fact*=num;
num--;
}
cout<<"The factorial is "<<fact;
getch();
}//end of the program
1 comment:
Slots & Casino Games - JTV Hub
Welcome to JTG, the place where everyone has the chance to 울산광역 출장안마 WIN BIG! Play our wide range 광주광역 출장마사지 of casino slots and 시흥 출장안마 live 시흥 출장안마 dealer 보령 출장마사지 casino games!
Post a Comment