Question

Problem 1: Complete this truth Table. Write a program that you can enter from the keyboard,a 1 or 0 into three Boolean variables, A,B,C. Write an if statement that tests the condition ( (A or B ) and C ). Run the program 8 separate times, testing each of the following 8 combinations. Write the results below in the following truth table: Problem 1-Complete this truth Table. Write a program that you can enter from the keyboard, a 1 or 0 into three Boolean variables, A,B,C. Write an if statement that tests the condition ( (A or B) and C). Run the program 8 separate times, testing each of the following 8 combinations. Write the results below in the following truth table. 0 01 0 1 0 1 00 1 01 1 10

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Screen short

main.cpp #include<stdio.h> 3 int AND(int a,int b)- && 1 4 if(a--1 b-1)return 1; 7 else return ; 8 11 int OR(int a ,int b) 12

Copy code

#include<stdio.h>

int AND(int a,int b){

if(a==1 && b==1)return 1;

else return 0;

}

int OR(int a ,int b){

if(a==0&&b==0)return 0;

else return 1;

}

int main()

{

int a,b,c;

int i=1;

while(i<=8){

printf("\nEnter the numbers : ");

scanf("%d%d%d", &a, &b, &c);

  

// for given expression

i++;

printf("\nResult : %d",AND(OR(a,b),c));

}

return 0;

}

Sample out put

gcc version 4.6.3 r the numbers r the numbers r the numbers Ente e e Result:0 Enter 01 Result:0 Ente 01 Result:0 Enter the nu

Add a comment
Know the answer?
Add Answer to:
Problem 1: Complete this truth Table. Write a program that you can enter from the keyboard,a...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 1. write a truth table using this symbol: --> 2. write the inputs for the truth...

    1. write a truth table using this symbol: --> 2. write the inputs for the truth table to the left of the --> and write the outputs for the truth table to the right of the --> 3. write the compliment, or NOT using ' As an example: The truth table for AND is written this way: A B --> A AND B 0 0 --> 0 0 1 --> 0 1 0 --> 0 1 1 --> 1 or...

  • C Program Question 1: Write a program that reads a date from the keyboard and tests...

    C Program Question 1: Write a program that reads a date from the keyboard and tests whether it contains a valid date. Display the date and a message that indicates whether it is valid. If it is not valid, also display a message explaining why it is not valid. The input date will have the format: mm/dd/yyyy Note that there is no space in the above format. A date in this format must be entered in one line. A valid...

  • 1- Write the unsimplified POS Boolean equation for F from the Truth Table. F = 2-...

    1- Write the unsimplified POS Boolean equation for F from the Truth Table. F = 2- Write the unsimplified SOP Boolean equation for F' from the Truth Table. F' = 3- Using only DeMorgan’s Theorem (show steps) and the unsimplified POS Boolean equation, find. maxterms minterms 0 1 0 1 0 1 10 101

  • Question 1: Write a program in C that reads a date from the keyboard and tests...

    Question 1: Write a program in C that reads a date from the keyboard and tests whether it contains a valid date. Display the date and a message that indicates whether it is valid. If it is not valid, also display a message explaining why it is not valid. The input date will have the format: mm/dd/yyyy Note that there is no space in the above format. A date in this format must be entered in one line. A valid...

  • Write a program that inputs up to 100 real numbers from the keyboard (one at a...

    Write a program that inputs up to 100 real numbers from the keyboard (one at a time). When a number greater than 1.0e9 is input the keyboard input will stop. Then the following statistic for the input data will be computed and printed out to the screen. a) average b) standard deviation c) minimum value d) maximum value e) range = (maximum-minimum)/2 f) the number of times zero is input **Note: this is a program in C++** 3) Write a...

  • Program : Write a complete C++ program that Input: Read a positive integer from the keyboard...

    Program : Write a complete C++ program that Input: Read a positive integer from the keyboard (user) with proper prompt text and save it to a variable. The integer have up to five digits. Processing: From the right most digit, extract every digit from the input integer using modular operator %then save the digit to a separate variable. Remove the right most digit from the integer using integer division operator /. Repeat above two steps till all digits have been...

  • guys can you please help me to to write a pseudo code for this program and...

    guys can you please help me to to write a pseudo code for this program and write the code of the program in visual studio in.cpp. compile the program and run and take screenshot of the output and upload it. please help is really appreciated. UTF-8"CPP Instruction SU2019 LA X 119SU-COSC-1436- C Get Homework Help With Che X Facebook -1.amazonaws.com/blackboard.learn.xythos.prod/584b1d8497c84/98796290? response-content-dis 100% School of Engineering and Technology COSC1436-LAB1 Note: in the instruction of the lab change "yourLastName" to your last...

  • 3. For the following circuit: B a. Give the truth table for F. b. Complete the...

    3. For the following circuit: B a. Give the truth table for F. b. Complete the following K-map and use it to give the minimized POS form for F(A,B,C). CIAB 00 01 11 10 C. Use boolean axioms and theorems on POS expression obtained in (b) to get the SOP form. The final SOP expression should have a maximum of two terms. d. Draw the logic circuit for the SOP form.

  • 13. Consider the following Truth Table, Boolean Equation, and K-map. Would you change anything? 5 pts...

    13. Consider the following Truth Table, Boolean Equation, and K-map. Would you change anything? 5 pts AB 11 10 0 ABCABC ABC ABC 1ABC ABC ABC ABc 00 01 Truth Table K-Map A B CY AB 01 10 10 1 0 0 00 01 11 10 0 0 10 0 1 01 0 1 11 1 0 0 0 1 0 10 Y = AB + BC

  • Can someone please code this problem in c++? Problem 1 You are to write a C++...

    Can someone please code this problem in c++? Problem 1 You are to write a C++ program to print the following design in the output window. (Note that * is an asterisk, which is commonly found above the 8 on a standard keyboard. On different terminal types, the asterisk may be rendered differently. You need not concern yourself with the appearance of the asterisk. When I run the program, as long as you have used the correct key on the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT