Howdy Folks!
I've been asked to write a program that reads in an interger N and calculates The factorial ...
I wrote this yesterday but it does not seem to work .. here's the code :
#include <iostream>
using namespace std;
int main()
{
int i=0;
int s=1;
int N;
int factorial;
cout << "Please Enter a number";
cin >> N;
while ( i <= N )
{ factorial = (N-i)*s;
s = (N-i);
i=i+1;
}
return 0;
}
What is wrong with it ?