I am doing this silly program as practice but am having problems with the condition in the if loop... Please help me. The condition after the color question goes directly to its condition without accepting an answer.
// Add directories
#include <cstdlib>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cmath>
using namespace std;
int main()
{
bool mahogany, teal; // answers for color question.
int color, x; // variables for the color and numb questions
char name[10]; // variable for name
color = mahogany, teal; // color == correct answers
mahogany= true, teal= true; // colors == true for if conditions
cout << "Please enter your name:\n " << endl; // Ask user for name
cin >> name; // hold the name variable
endl(cout); // skip a line
cout << "What is your favorite color?\n " << endl; // Ask user for fav color
cin >> color; // hold the color variable
endl(cout); // skip a line
if (true)
{
cout << "What is your favorite number?\n" <<endl; // Ask user for fav num
cin >> x; // hold the x variable
endl(cout); // skip a line
if (x == 7)
{
cout << "Hi " << name << ", I see you!" << endl;
endl(cout); // skip a line
}
else if (x == 3)
{
cout << "Hi " << name << ", I see you!" << endl;
endl(cout); // skip a line
}
else
{
cout << "Please exit this application.\n" << endl; // Wrong answer
}
}
else if (false)
{
cout << "Please exit this application.\n" << endl; // Wrong answer
}
system("PAUSE");
return EXIT_SUCCESS;
}