-
Program failure
I have tried to make a program but it fails when compiled and run. Could someone check it out and tell me what's wrong.
Code:
#include <iostream>
using namespace std;
int main()
{
int thisisanumber;
cin>> thisisanumber;
cin.ingnore();
if ( thisisanumber > 5 ) {
cout<<"hi";
}
cin.get();
return 0;
}
My intention is to enter any number which is over 5 so i get the message hi.. :confused:
-
Code:
if ( thisisanumber <5 ) {
cout<<"hi";
}
Also your brackets doesnt add up.
-
:confused: Doesn't ring a bell.
-
you last '{' shouldnt be there.
-
K, but i get also an error with int main().
-
-
I don't see any errors (except spelling). I get a warning when I compile, which is resolved by putting a return 0; at the end of your code.
-
/Documents and Settings/John Doe/Desktop/Uusi kansio2/old.cpp C:\Documents and Settings\John Doe\Desktop\Uusi kansio2\C In function `int main()':
-
10 C:\Documents and Settings\John DOe\Desktop\Uusi kansio2\old.cpp ` ingnore' undeclared (first use this function)
-
and the part after that line??
-
You spelled ignore wrong.
It's:
Not:
-
-
Hurray lol it works. Thanks all :)