Question

Write a C++ program to construct the truth table of P || !(Q && R)

Write a C++ program to construct the truth table of P || !(Q && R)

Homework Answers

Answer #1
#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;
}

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Use a truth table to determine whether the two statements are equivalent. ~p->~q, q->p Construct a...
Use a truth table to determine whether the two statements are equivalent. ~p->~q, q->p Construct a truth table for ~p->~q Construct a truth table for q->p
Construct an indirect truth table for this argument. ∼A • ∼(R ∨ Q)   /   B ≡ ∼Q   //  ...
Construct an indirect truth table for this argument. ∼A • ∼(R ∨ Q)   /   B ≡ ∼Q   //   B ⊃ J From your indirect truth table what can you conclude? The argument is valid and the value of the letter R is True. The argument is valid and the value of the letter R is False. The argument is invalid and the value of the letter R is True. The argument is invalid and the value of the letter R is False.
   Write a C++ program to generate all the truth tables needed for ( p ˄...
   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
Use a truth table to determine whether the following argument is valid. p →q ∨ ∼r...
Use a truth table to determine whether the following argument is valid. p →q ∨ ∼r q → p ∧ r ∴ p →r
1) Show that ¬p → (q → r) and q → (p ∨ r) are logically...
1) Show that ¬p → (q → r) and q → (p ∨ r) are logically equivalent. No truth table and please state what law you're using. Also, please write neat and clear. Thanks 2) .Show that (p ∨ q) ∧ (¬p ∨ r) → (q ∨ r) is a tautology. No truth table and please state what law you're using. Also, please write neat and clear.
are they logically equivalent (show how) truth table or in word:: a) p —> ( q...
are they logically equivalent (show how) truth table or in word:: a) p —> ( q —> r ) and ( p -> q) —> r b) p^ (q v r ) and ( p ^ q) v ( p ^ r )
For three statements P, Q and R, use truth tables to verify the following. (a) (P...
For three statements P, Q and R, use truth tables to verify the following. (a) (P ⇒ Q) ∧ (P ⇒ R) ≡ P ⇒ (Q ∧ R). (c) (P ⇒ Q) ∨ (P ⇒ R) ≡ P ⇒ (Q ∨ R). (e) (P ⇒ Q) ∧ (Q ⇒ R) ≡ P ⇒ R.
Prove: (p ∧ ¬r → q) and p → (q ∨ r) are biconditional using natural...
Prove: (p ∧ ¬r → q) and p → (q ∨ r) are biconditional using natural deduction NOT TRUTH TABLE
Use a truth table to determine if the following is a logical equivalence:   ( q →...
Use a truth table to determine if the following is a logical equivalence:   ( q → ( ¬ q → ( p ∧ r ) ) ) ≡ ( ¬ p ∨ ¬ r )
Question 1 and 2 requires you to create a program ( you need to submit the...
Question 1 and 2 requires you to create a program ( you need to submit the source code and screenshot for the output), and question 3 and 4 requires solving the problems (no programs needed for those two questions). 1.Write a C++ program to construct the truth table of P ∨¬(Q ∧ R) 2.Write a C++ program to verify that the proposition P ∨¬(P ∧Q) is a tautology.
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT