for loop question

hi guys im writing a code to compute a factorial and when i enter the number, it skips a line and the program doesn't do anything. help please

#include <iostream>

using namespace std;

int main()
string in;
int factorial,num,count;
cout << "Enter a number:" << endl;
cin >> num;
while (cin >= 0)

cout << endl;
cout << "The factorial of " << num << " is " << factorial;

return 0;
while (cin >= 0)

What is this doing here?
replace while loop with while(num>=0)
Topic archived. No new replies allowed.