{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

assignment12

# assignment12 -...

This preview shows page 1. Sign up to view the full content.

/* Write a program to create the following truth table. DO NOT HARD-CODE THE ANSWERS IN THE OUTPUT! This means that each of the cout statements must use variables for the "1" and "0" values. In this exercise, you need to make the output match exactly, including the spacing on each line. x | y | (x && y) | !(x && y) =============================== 1 | 1 | 1 | 0 1 | 0 | 0 | 1 0 | 1 | 0 | 1 0 | 0 | 0 | 1 */ 0 #include<iostream> using namespace std; int main () { bool x,y; b cout << " x\t|\ty\t|\t(x && y)\t|\t!(x && y)" << endl;
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: cout << "=================================" << endl; x = true, y = true ; cout << x << "\t|\t" << y << "\t|\t" << (x&&y) << "\t\t|\t" << !(x&&y)<< endl; x = true, y = false ; cout << x << "\t|\t" << y << "\t|\t" << (x&&y) << "\t\t|\t" << !(x&&y)<< endl; x= false, y = true; cout << x << "\t|\t" << y << "\t|\t" << (x&&y) << "\t\t|\t" << !(x&&y)<< endl; x = false, y = false; cout << x << "\t|\t" << y << "\t|\t" << (x&&y) << "\t\t|\t" << !(x&&y)<< endl; c }...
View Full Document

{[ snackBarMessage ]}