hello, I am following a book and im stuck on this one.....(note it's tacky but just bear with me, im a newb)
#include <iostream.h>
int main()
{
int RedSoxScore, YankeesScore;
cout<<"Enter the score for the RedSox:";
cin>> RedSoxScore;
cout<<"Enter the score for the yankees:";
cin>> YankeesScore;
cout<<"\n";
if (RedSoxScore > YankeesScore)
cout<<"GO THE BLIMMIN REDSOX!!\n";
if (YankeesScore > RedSoxScore )
{
cout<<"WHOOPY GO THE YANKS!!!\n";
cout<<"Happy days in NYC!!!\n";
}
if (RedSoxScore == YankeesScore)
{
cout<<"A tie?, nha cant be!\n";
cout<<" Give me the real score for the yanks:";
cin >> YankeesScore;
if (RedSoxScore > YankeesScore)
cout<<"Knew it, Go the sox!!";
if (YankeesScore > RedSoxScore)
cout<<"Knew it go the yanks!!";
if (YankeesScore == RedSoxScore)
cout<<"Wow, it was tie!?";
}
cout<<"\nThanks for telling me.\n";
return 0;
}
I know im using the old .h header files, because that's what the book uses (it says i can use the new standards if i want, using namespace std but my code tends to not work sometimes. So im sticking to the old ones just untill i get the hang of things.
Anyway i compiled the following on devc++ and it runs the first few line well untill the command promt suddently closes after line 9.
The code seems to be fine because it compiled, but it just flashes.
Any ideas as to what im doing wrong?....
-Thanks