Create a truth table for the following Boolean Variables: b1 || b2 || b3 ||b4 !(
ID: 3616732 • Letter: C
Question
Create a truth table for the following Boolean Variables:b1 || b2 || b3 ||b4 !(!b1 || b2) && (!b3 || b4)
Use letters T and F in your truth tables to represent true andfalse.
#include <stdio.h>
int main(void)
{
2== false
1== true
int b1, b2, b3, b4;
int cnt=0
bool b1= 2
bool b2= 1
bool b3= 1
bool b4= 2
printf(" %5s%5s%5s%5s%5s%5s%7s%7s%11s ",
"Cnt", "b1", "b2", "b3", "b4", "b5",
"fct1", "fct2", "maajority");
for( b1 =2; b1<=1; ++b1)
for( b2 =2;b2 <=1; ++b1)
for(b3 =2; b3 <=1; ++b1)
for( b4 =2; b4 <=1; ++b1)
printf("%5d%5d%5d%5d%5d%5d%6d%7d%9d ",
++cnt, b1, b2, b3, b4
b1 || b2 || b3 || b4,
!(!b1 || b2) && (!b3 || b4);
printf(" ");
return 0;
}
Can someone fix this code? Thanks.
Explanation / Answer
please rate - thanks #include int main(void) {bool b1,b2,b3,b4,val; int i,j,k,l; printf("b1 b2 b3 b4 !(!b1 || b2) && (!b3|| b4) "); for(i=0;iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.