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 is technologically backward country? Options United States U K CHILE INDIA
agasfer [191]
The answer is India.

There are a lot of factors affecting India in becoming backward in technology competitiveness. 
One factor is producing or exporting lots of engineers to other countries leaving average skills in the country. Second, poor government institutes. Next, problems with budget allocations. 
3 0
3 years ago
What is commodity? explain
timama [110]
A raw material or primary agricultural product that can be bought and sold, such as copper or coffee.
6 0
3 years ago
Which tool could be used to display only rows containing presidents who served two terms?
kherson [118]

Answer: The tool that could be used to display only the rows containing the presidents who served two terms is the<u> Filter.</u>

Explanation:

If you are using Excel the filter tool is a great way to find the relevant information you are searching for. This will remove all other data from the search results, in this case presidents that only served one term.

The filtering of rows can be used three ways;

  • By the value
  • By the criteria
  • By the format

By using the filter, you can find any phrase, number, dates, etc. Multiple columns can be filtered at the same time. Also, blank cells can be filtered out.

5 0
3 years ago
Read 2 more answers
1. ¿Qué es un cursograma?
erma4kov [3.2K]

Answer:

Un cursograma permite representar gráficamente procedimientos administrativos. Constituyen instrumentos importantes para la visualización global y esquemática del conjunto de tareas administrativas.

6 0
2 years ago
Read 2 more answers
What is Selection statement?​
Sati [7]

Answer:

Selection statements (sometimes called conditional statements) can be defined as code (statements) that is executed only when a certain condition is satisfied.Selection is a powerful tool to control when and which code statements will run.

3 0
2 years ago
Read 2 more answers
Other questions:
  • Host A and B are directly connected with a 100 Mbps link. There is one TCP connection between the two hosts, and Host A is sendi
    14·1 answer
  • Why is the stateless nature of the internet a problem for shopping cart software? g?
    5·2 answers
  • Using a cell phone while operating a motor vehicle is considered distraction because
    8·1 answer
  • What is the difference between word processing software and email?
    12·2 answers
  • Assign the size of userInput to stringSize. Ex: if userInput is "Hello", output is: Size of userInput: 5
    7·1 answer
  • How do you change the name on your brainly account?
    12·1 answer
  • What would happen if computers only had input devices?
    9·1 answer
  • What is the value of the variable result after these lines of code are executed?
    11·1 answer
  • How are actual rocket launches similar to how balloon rockets and canister rockets launch?
    6·1 answer
  • Imagine that you need to prepare for three end-of-term tests. What steps will you take to make sure your study time is well spen
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!