I was trying if statements and else and I had a few errors. I was doing the example because I feel like that best way to learn for me. I going to show you my errors that pop-up and I would appreciate any feedbacks.
I checked all the syntax and I think all of them are there. I made sure with the brackets.
#include <iostream>
usingnamespace std;
int main ()
{
int age;
cout<<"Please enter your Age";
cin >>age;
cin.ignore ();
if ( age< 100)(
cout<<"You are pretty young!\n";
)
else (age ==100)(
cout<<"You are really old\n";
)
cin.get();
}
||=== if statments, Debug ===|
C:\Users\gameffect\Documents\if statments\ifstatementsex.c|1|error: iostream: No such file or directory|
C:\Users\gameffect\Documents\if statments\ifstatementsex.c|3|error: expected '=', ',', ';', 'asm' or '__attribute__' before 'namespace'|
C:\Users\gameffect\Documents\if statments\ifstatementsex.c||In function 'main':|
C:\Users\gameffect\Documents\if statments\ifstatementsex.c|9|error: 'cout' undeclared (first use in this function)|
C:\Users\gameffect\Documents\if statments\ifstatementsex.c|9|error: (Each undeclared identifier is reported only once|
C:\Users\gameffect\Documents\if statments\ifstatementsex.c|9|error: for each function it appears in.)|
C:\Users\gameffect\Documents\if statments\ifstatementsex.c|10|error: 'cin' undeclared (first use in this function)|
C:\Users\gameffect\Documents\if statments\ifstatementsex.c|14|error: expected ')' before ';' token|
C:\Users\gameffect\Documents\if statments\ifstatementsex.c|16|error: expected ';' before 'else'|
||=== Build finished: 8 errors, 0 warnings ===|