Find Factorial.....Guys please tell me where i am wrong

#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();

}


Enter a positive integer:4
The factorial of 4 is 24
the factorial of 4 is 24... what is the issue?
Topic archived. No new replies allowed.