Write a c-program to evaluate and print the truth table for (P ∧ Q) ∨ R.
Answer:
Step 1
Program:
Programs are used to interact with the computer system. The main objective of the program is problem-solving and providing interaction. Even the complex problems are solved using the programs and several tasks are performed based on the instructions given to the program.
A program is a code, that contains the instructions to do the task. The instructions are provided by the programmer using the programming languages such as Java, C, C++, etc. These programming languages read the input from various devices, processes it, and return the output.

Step 3
#include<stdio.h>
#include<conio.h>
void main()
{
int p,q,r;
printf("P\tQ\tR\t(P∧Q)\t(P∧Q)VR");
for(p=0;p<=1;++p)
{
for(q=0;q<=1;++q)
{
for(r=0;r<=1;++r)
{
printf("\n%d\t%d\t%d\t%d\t%d",p,q,r,(p&&q),(p&&q)||r);
}
}
}
getch();
}
