Write a C++ program to generate all the truth tables needed for ( p ˄ q) ˅ (¬ p ˅ ( p ˄ ¬ q )). You need to submit your source code and a screen shot for the output
#include <iostream> using namespace std; int main() { cout<<"p\tq\t( p ˄ q) ˅ (¬ p ˅ ( p ˄ ¬ q ))"<<endl; for(int p = 0;p<=1;p++){ for(int q=0;q<=1;q++){ cout<<p<<"\t"<<q<<"\t"<<(( p && q) || (!p || ( p && !q )))<<endl; } } return 0; }
Get Answers For Free
Most questions answered within 1 hours.