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
1. Construct a truth table for: (¬p ∨ (p → ¬q)) → (¬p ∨ ¬q) 2....
1. Construct a truth table for: (¬p ∨ (p → ¬q)) → (¬p ∨ ¬q) 2. Give a proof using logical equivalences that (p → q) ∨ (q → r) and (p → r) are not logically equivalent. 3.Show using a truth table that (p → q) and (¬q → ¬p) are logically equivalent. 4. Use the rules of inference to prove that the premise p ∧ (p → ¬q) implies the conclusion ¬q. Number each step and give the...
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
1) a.draw the truth table for s: (p and r) or (q and not r) b....
1) a.draw the truth table for s: (p and r) or (q and not r) b. assuming s and q are true but p is false, deduce the value of r. explain c. draw the truth table for s: r ---> not (p and q) d. assuming q is true, deduce the values of s, p, and r. Explain
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.
For each of the following propositions construct a truth table and indicate whether it is a...
For each of the following propositions construct a truth table and indicate whether it is a tautology (i.e., it’s always true), a contradiction (it’s never true), or a contingency (its truth depends on the truth of the variables). Also specify whether it is a logical equivalence or not. Note: There should be a column for every operator. There should be three columns to show work for a biconditional. c) (P V Q) Λ ( ¬(? Λ Q) Λ (¬?)) d)...
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.