use code tags and more formatting... here's an example and a way to use the 'else' part of the if-else if-else statement:
Code:
#include <iostream.h>
int main()
{
int a; // no need to initialize
cout<<"What is 3+3: ";
cin>>a;
if(a>6)
cout<<"Nope. too high";
else if(a<6)
cout<<"Nope. too low";
else
cout<<"Good job! ";
return 0;
}
or this is also good:
Code:
#include <iostream.h>
int main()
{
int a; // no need to initialize
cout<<"What is 3+3: ";
cin>>a;
if(a!=6)
cout<<"Nope.";
else
cout<<"Good Job!";
return 0;
}