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
guapka [62]
2 years ago
10

The function of anOR gate can best be described as a gate which provides an output of 1 only when

Computers and Technology
1 answer:
amid [387]2 years ago
5 0

Answer:

Following are the program to this question:

#include <iostream>//defining header file

using namespace std;

void OR_gate()//defining a method OR_gate

{

bool a,b;//defining bool vaiable

cin>>a>>b;//input value

if(a or b)//use if block to check condition

{

cout<<"1";//print message

}

}

int main()//defining main method

{

OR_gate();//calling method OR_gate  

return 0;

}

Output:

0

1

1

Explanation:

In the above program, a method "OR_gate" is declared, and inside the method two bool variable "a and b" is defined, which input the value from the user end.

In the next step, an if block is defined, that uses the or gate to check input value and print the value that is equal to 1, and inside the main method, it call the "OR_gate" method.

You might be interested in
What is one advantage and disadvantage of designing a support security that might be based on a centralized model, where all sen
defon

Co-Ordination Difficulty: ...
Waste of Resources: ...
Larger Interests of the Enterprise Neglected: ...
Emergency Decision not Possible: ...
Lack of Qualified Managers: ...
Certain Activities Decentralization not Possible:
8 0
2 years ago
Is a plotter input output or both
erastova [34]

Answer:

it is output

Explanation:

it just is .

5 0
3 years ago
How does Google work, why does it work that way?
Oxana [17]

Answer:

Google uses automated programs called spiders or crawlers, just like most search engines, to help generate its search results. Google has a large index of keywords that help determine search results. ... Google uses a trademarked algorithm called PageRank, which assigns each Web page a relevancy score.

8 0
2 years ago
Read 2 more answers
The "fathers of the internet" are vinton cerf and ________.
Harrizon [31]
Robert E Kahn I hope this helps
8 0
2 years ago
Write a program that declares a two-dimensional array named myFancyArray of the type double. Initialize the array to the followi
kirill115 [55]

Answer:

This solution is provided in C++

#include <iostream>

using namespace std;

double sumFancyArray(double myarr[][6]){

   double sum = 0.0;

   for(int i = 0;i<2;i++)    {

       for(int j = 0;j<6;j++){

       sum+=myarr[i][j];    

       }}    

   return sum;

}

void printFancyArray(double myarr[][6]){

   for(int i = 0;i<2;i++)    {

       for(int j = 0;j<6;j++){

       cout<<myarr[i][j]<<" ";    

       }

   }

}

int main(){

   double myFancyArray[2][6] = {23, 14.12, 17,85.99, 6.06, 13, 1100, 0, 36.36, 90.09, 3.145, 5.4};

   cout<<sumFancyArray(myFancyArray)<<endl;

   printFancyArray(myFancyArray);

   

   return 0;

}

Explanation:

This function returns the sum of the array elements

double sumFancyArray(double myarr[][6]){

This initializes sum to 0

   double sum = 0.0;

This iterates through the row of the array

   for(int i = 0;i<2;i++)    {

This iterates through the column

       for(int j = 0;j<6;j++){

This adds each element

       sum+=myarr[i][j];    

       }}    

This returns the sum

   return sum;

}

This method prints array elements

void printFancyArray(double myarr[][6]){

This iterates through the row of the array

   for(int i = 0;i<2;i++)    {

This iterates through the column

       for(int j = 0;j<6;j++){

This prints each array element

       cout<<myarr[i][j]<<" ";    

       }

   }

}

The main starts here

int main(){

This declares and initializes the array

   double myFancyArray[2][6] = {23, 14.12, 17,85.99, 6.06, 13, 1100, 0, 36.36, 90.09, 3.145, 5.4};

This calls the function  that returns the sum

 cout<<sumFancyArray(myFancyArray)<<endl;

This calls the function that prints the array elements

   printFancyArray(myFancyArray);

   

   return 0;

}

Download cpp
7 0
2 years ago
Other questions:
  • In Linux, the most popular remote access tool is OpenSSH. Which software performs the same remote command line (CLI) access from
    7·1 answer
  • Does time complexity depend on, which base arithmetic you use? like base 10, 2 or whatever else? Does time coplexity depned on t
    13·1 answer
  • Which of the following programs can open a bitmap file?
    11·2 answers
  • Which of the following components controls the opening and closing of the valves in an engine ?
    15·2 answers
  • What is the name for a partition that has been formatted and assigned a drive letter?
    8·1 answer
  • What is a file type and why is it important? Give at least three examples of file
    7·1 answer
  • It’s Saturday and you’re looking forward to hanging out with friends and having some fun. However, you get two phone calls early
    10·1 answer
  • Does any of yall play rob lox?
    5·2 answers
  • What can handle work that is hard on a person and could cause repetitive injuries?
    6·1 answer
  • Please help me with coding!
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!