To make it more concise you need to use functions. Some examples of functions you need are: void OutputAndTable(bool *p, bool *q) { cout << "p | q" << " | " << "p A q" << endl; for (int i = 0; i < LOGICARRAYSIZE; i++) { cout << setw(1) << p[i] << " | "; for (int j = 0; j < 1; j++) { cout << setw(1) << q[i] << " | " << setw(3) << (p[i] && q[i]); } cout << endl; } } void GetAnInput(const char *question, string &answer) { cout << question << endl; cin >> answer; MyIgnoreCase(answer); } void GetAllInput(string &andor, string &ansp, string &ansq) { GetAnInput("Do you want to AND or OR the two propositional variables?", andor); if ((andor != "AND") && (andor != "OR")) { cerr << "ERROR: Please enter a valid values - (AND or OR)." << endl; } GetAnInput("Do you want to NOT p? Y/N", ansp); GetAnInput("Do you want to NOT q? Y/N", ansq); } The function GetAllInput() show's how you can handle inputs better, although to truely handle inputs better you would want to loop until you get the correct answer. To ignore case, choose your internal representation, either all capitals or all lower case and then convert the strings to your desired internal representation. The following function provides an example: /** * Ignore the case of the input by making everything upper case. */ void MyIgnoreCase(string &answer) { for (int i = 0; i < answer.size(); i++ ) { answer[i] = toupper(answer[i]); } } To make your code even more concise you should simplify your if statements: bool p[LOGICARRAYSIZE] = { true, true, false, false }; bool q[LOGICARRAYSIZE] = { true, false, true, false }; bool notp[LOGICARRAYSIZE]; for (int i = 0; i < LOGICARRAYSIZE; i++ ) { notp[i] = !p[i]; } bool notq[LOGICARRAYSIZE]; for (int i = 0; i < LOGICARRAYSIZE; i++ ) { notq[i] = !q[i]; } GetAllInput(andor, ansp, ansq); bool *PParameter; bool *QParameter; if (ansq == "Y") { QParameter = q; } else { QParameter = notq; } if (ansp == "Y") { PParameter = p; } else { PParameter = notp; } if (andor == "AND") { OutputAndTable(PParameter, QParameter); } You should also replace '4' with a constant that helps your reader understand your code better: const int LOGICARRAYSIZE = 4; References you should look at are http://en.cppreference.com/w/cpp/string/byte/toupper and http://en.cppreference.com/w/cpp/string/basic_string