#include<iostream>
#include<conio.h>
using namespace std;
int main()
{
int number;
int factorial,i;
char ch;
main:
cout << "Enter a positive integer: ";
cin >>number ;
if(number<0)
{
cout<<"\nERROR Enter only possitive number... TRY AGAIN\n Y OR N\n";
cin>>ch;
if(ch=='y' || ch=='Y')
goto main;
else
goto end;
}
else
for (i = 0; i <= number; i++)
if (i == 0)
factorial = 1;
else
factorial = factorial * i;
cout << "The factorial of " << number << " is " << factorial << endl;
end:
getch();