1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
aniked [119]
3 years ago
14

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. W

rite 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.
Module 9-Alternative Sequences and Complex logical Criteria v17 (1).pdf. Adobe Acrobat Reader DC
File Edit View Window Help
Home Tools Module 9 - Altema...X
A B C (A or B ) (A or B ) and C
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1

Computers and Technology
1 answer:
SSSSS [86.1K]3 years ago
8 0

Answer:

Following are the code to this question:

#include<stdio.h>//defining header file

int AND(int x,int y) //defining a method AND that hold two variable in its parameter

{

if(x==1 && y==1)//defining if block to check x and y value is equal to 1

{

return 1;//return value 1

}

else //defining else block

{

   return 0;//return value 0

}

}

int OR(int x,int y)//defining method OR that hold two variable in its parameter

{

if(x==0&&y==0)//defining if block to check x and y value is equal to 1

{

return 0;//return value 0

}

else //defining else block

{

   return 1;//return value 1

}

}

int main()//defining main method

{

int a,b,c;//defining integer variable  

int k=1;//defining integer variable k that holds a value 1

while(k<=8)//defining while loop for 8 time input

{

printf("Please insert 3 numbers in (0 0r 1):\n ");//print message

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

k++;//increment the value of k by 1

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

}

return 0;

}

Output:

please find the attachment.

Explanation:

In the above-given C language code two methods "AND and OR" is declared, holds two integer variable "x and y" in its parameters, inside the method a conditional it used that can be defined as follows:

  • In the AND method, inside a conditional statement, if block check x and y both value is same that is 1 it will return 1 or it will goto else block in this it will return value 0.      
  • In the OR method, inside a conditional statement, if block check x and y both value is the same, that is 0 it will return 0 or it will goto else block in this it will return value 1.
  • In the main method, four integers "a,b,c, and k" is declared in which variable "a, b, c" is used in the loop for 8 times input values from the user and print method is used to call the method and prints its return values.

You might be interested in
Which of the following is TRUE about this statement?
Lynna [10]

E. This statement increments (++) the dereferenced pointer's value (array) by one then "assign" that value.

7 0
3 years ago
___ is two or more connected computers
quester [9]
NETWORK is two or more computers connected together
8 0
3 years ago
Which magazine can help the public to determine the best technology to buy?
fredd [130]
Consumer Reports Of Course :D :v
8 0
3 years ago
Read 2 more answers
The collection of programs on a computer is referred to as _______________.​
schepotkina [342]
It is referred to as software

Software consists of an entire set of programs and routines linked with the operation of a computer. In other words, it is a collection of executable instructions that enable you to interact with a computer and its hardware. A computer would be rendered useless without software.

 






5 0
3 years ago
I WILL MAKE BRAINLIEST PLS HURRY
Oksanka [162]

Examples

<u>Lists: </u>

- Keep track of how much water you drink per day

- Hours spent on studying per week

- The growth of a plant

<u>Dictionaries:</u>

- Keep track of overall grades for each subject

- Keep track of where money is mostly spent on

- Dates for upcoming assessments and tests

Hope these examples help :)

5 0
3 years ago
Read 2 more answers
Other questions:
  • . the web is based on the ________ protocol
    6·1 answer
  • Which of the following protects against cave-ins? A. All answer choices protect against cave-ins B. Shielding C. Shoring D. Slop
    5·2 answers
  • If johanna wants to label the x- and y-axes, she should click Layout, then
    8·1 answer
  • How are traditional technology and modern technology related to each<br>other? ​
    9·2 answers
  • After compiling source code, which command still needs to be run in order to copy the newly compiled binaries into a directory l
    5·1 answer
  • Given six memory partitions of 100 MB, 170 MB, 40 MB, 205 MB, 300 MB, and 185 MB (in order), how would the first-fit, best-fit,
    10·1 answer
  • The declarations and statements that compose the method definition are called the __________.
    9·1 answer
  • Holly the Hacker has a list of 100,000 common passwords. She wants to use this list to break into UNIX-like systems that use a p
    14·1 answer
  • EASY What does the Backspace key do?
    6·1 answer
  • Bluetooth is the popular name for the 802. 15 wireless networking standard, which is useful for creating small __________.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!