Write a C++ program to construct the truth table of P || !(Q && R)
#include <iostream> using namespace std; int main() { cout<<"P\tQ\tR\tP || !(Q && R)\n"; for(int P=0;P<=1;P++){ for(int Q=0;Q<=1;Q++){ for(int R=0;R<=1;R++){ cout<<P<<"\t"<<Q<<"\t"<<R<<"\t"<<(P || !(Q && R))<<endl; } } } return 0; }
Get Answers For Free
Most questions answered within 1 hours.