# little question

view full story

http://www.daniweb.com – Hello everyone... I have 2 questions and it would be great if you guys can help me on these. I wrote a factorial program and it works already. The problem is when it comes to higher outputs. For example: 11 P 5 = 55440 // this works so far but 13 P 5 = 154440 // but my output is 47917 Im using already long instead of integer. Can someone help me out on this? Second thing is, how do i avoid that someone will enter letters? :-) Btw my code is: #include <iostream> using namespace std; long factorial (long n) {   if (n > 1)   return (n * factorial (n-1));   else   return (1); } int main () {         cout<< " WELCOME TO THE 2 BASED FACTORIAL CALCULATOR " << endl << endl; start:;   long number;   cout << "Please type a number: ";   cin >> number;   long number2;   cout << endl << "Please type a 2nd number: ";   cin >> number2;   long number3;       number3 = factorial(number) / factorial(number - number2);           {             if (number < number2)           {                                     cout<< "Please let the first number be bigger than the second number." << endl << endl;                   goto start;           }           if (number >= number2)           {                   cout << endl << number << " P " << number2 << " = " << number3 << endl << endl;           }   }   goto start;   return 0; } (General)