Help me please
Mar 1, 2008 at 12:14pm
Ok so basically because the loop runs so fast in this code i dont get to see what the cout is. heres the code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
#include<iostream>
using namespace std;
int main()
{
int score;
cout << "Enter your score: ";
cin >> score;
if (score > 500)
cout << "\nYou got over 500. Nice score.\n";
else
cout << "\nYou got 500 or less. Nothing to brag about.\n";
return 0;
}
|
i tried using cin.ignore() but it didn't work. please help me out :D
Mar 1, 2008 at 12:50pm
try cin.get() instead of cin.ignore();
but both of them should work.
//.....
cin.get();
return 0;
}
Mar 1, 2008 at 9:51pm
It still does the same thing :(
Mar 2, 2008 at 11:28am
hmm, then try:
and if this is't going to work, then there must be something wrong with your pc;-)
Mar 3, 2008 at 2:32am
Thanks it works perfect now :D
Topic archived. No new replies allowed.