Im a beginner. What is wrong?
---------------------------------------------
#include <iostream>
using namespace std;
int main()
{
char Abfrage;
cout << "Bitte 'A' eingeben!" << endl;
cin >> Abfrage >> endl;
cout << "Wird geprüft..." << endl;
system("PAUSE");
if (Abfrage == 'A')
{
cout << "Sie haben 'A' gedrueckt!" << endl;
system("PAUSE");
}
else if
{
cout << "Sie haben nicht 'A' gedrueckt!" << endl;
system("PAUSE");
}
return = 0;
}
Firstly, this:
cin >> Abfrage >> endl;
How can you input to endl? endl is "end of line". It's for outputting.
return = 0;
Did you mean return 0;
?
else if
else if what? Did you mean else
?
system("PAUSE");
This is very bad practice. Please don't do it.
Last edited on