answer.
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]
1 year 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]1 year 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
CodeLab Question
castortr0y [4]

Answer:

Idk the language of code but here is how it would be done in python

myAlarm():

   arm = True

   code = "secret message"

myAlarm()

main():

deactivate = input(">>> ")

if deactivate = myAlarm.code:

  arm = False

Im still a little confused on the question.

(I am a game designer and I code daily)

3 0
1 year ago
Stan’s assignment is to print a three-dimensional image on a piece of paper. Which printing technique should he use?
Zigmanuir [339]

Answer:

to print a three-dimensional image on a piece of paper he should use autocad

8 0
1 year ago
Read 2 more answers
An employee sets up an automation that transfers files in a specific folder on their PC to a remote drive for archiving, provide
Yuri [45]

Answer:

Rule based automation

Explanation:

8 0
1 year ago
When a CPU executes instructions as it converts input into output, it does so with
yuradex [85]
The power of science of course
8 0
1 year ago
Which of the following would not be considered metadata for a spreadsheet file?
Genrish500 [490]

Answer:

B.

Explanation:

Metadata is a type of data that dispense details of other data. In simple terms, metadata can be defined as information of a file such as file name, attributes, etc.

<u>In excel sheet, metadata works the same and helps to provide information about </u><u>file name, author name, file size, attributes such as read-only, archieve, hidden, system, location of the file, date and time of creation, modification, or accessed, type of file, etc</u><u>.</u>

From the given options, the information that is not considered or included in metadata is calculation inside the file. Metadata in excel sheet does not include calculations inside the file. Thus option B is the correct answer

7 0
1 year ago
Other questions:
  • Copy the 10 statements as they appear below into your journal.
    6·2 answers
  • Write a program that defines a type for a structure that stores information on a student in ENG EK 125. Declare two variables to
    8·1 answer
  • Which of the following statements is incorrect? An operating system provides an environment for the execution of programs. An op
    15·1 answer
  • Alex is nearing graduation. His counselor showed him this information. Alex's College Costs &amp; Payment Options per Year Costs
    5·2 answers
  • If the input is negative, make numItemsPointer be null. Otherwise, make numItemsPointer point to numItems and multiply the value
    9·1 answer
  • Use the single-server drive-up bank teller operation referred to in Problems 1 and 2 to determine the following operating charac
    10·1 answer
  • You are working on a documentation file userNotes.txt with some members of your software development team. Just before the file
    12·1 answer
  • Are bpos safe for organisations ? State your views on it
    8·1 answer
  • A credit card company receives numerous phone calls throughout the day from customers reporting fraud and billing disputes. Most
    10·1 answer
  • a. a large central network that connects other networks in a distance spanning exactly 5 miles. b. a group of personal computers
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!