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
Murljashka [212]
4 years ago
7

2.8 Code Practice: Question 1

Computers and Technology
2 answers:
likoan [24]4 years ago
6 0

Input: A = 2, B = 8, C = 1

Output: Largest number = 8

-BARSIC- [3]4 years ago
4 0

Answer:

The program to this question can be given as:

Program:

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

int main() //define main method.

{

int a1,b1,c1; //define variable

printf("Enter three numbers:\n"); //message

scanf("%d",&a1); //input numbers.

scanf("%d",&b1);//input numbers.

scanf("%d",&c1);//input numbers.

if (a1>b1) //check condition

{

//check condition

if(a1>c1)//inner if block

{

printf("The largest number: %d", a1); //message

}

else  //inner else block

{

printf("The largest number: %d", c1);//message

}

}

else //else block

{

//check condition

if(b1>c1) //inner if block.

{

printf("The largest number: %d", b1);//message

}

else //else block

{

printf("The largest number: %d",c1);//message

}

}

return 0;  //return 0.

}

Output:

Enter three numbers:

22

44

11

The largest number: 44

Explanation:

The description of the above program can be given as:

  • In the C language program firstly we define the header file. Then we define the main function. In the main function, we define three variables that are "a1, b1 and c1". In this variable, we take input from the user.
  • Then we define the conditional statements. In the if block we check if the value of a1 is greater then the value of b1 if this condition is true so we use another condition that if the value of a1 is greater then the value of c1. so, it will print the largest value. If the above condition is not true then it will go to else section.
  • In the else part we check the condition that if the value of b1 is greater then the value of c1. if it is true it will print the largest number value.  
You might be interested in
John is directing a television series. He has to shoot a scene that presents the lead character in a dominating and commanding p
user100 [1]
Answer is high angle so it hits better lighting
7 0
2 years ago
How to reduce hard drive failure data loss?
malfutka [58]
<span>Regularly schedule "fire drills" to restore information from backup
Keep it away from Dusty areas
Have a battery back up system
P</span><span>rotect equipment from static electricity that can erase data or damage components.
Hope that answers your question

</span>
7 0
3 years ago
Write a program that reads a target string from the keyboard and then another sentence string from the keyboard.
Rzqust [24]

The solution is in the attachment

5 0
4 years ago
The fundamental difference between a switch and a router is that a switch belongs only to its local network and a router belongs
Alla [95]

Answer:

The answer is True

Explanation:

Switches are responsible for connecting computers within a network and it belongs only to its local network. Its responsibility is to filter and forward packets between LAN segments. They operate on layer two (2) and sometime layer three (3) of the OSI Model.

Routers on the other hand, are responsible for the interconnections of two or more networks. They forward data packets between networks. They reside at gateways, exactly where two or more networks connects. And they use communication protocols to effectively and efficiently communicate among two or more host.

7 0
3 years ago
Write down the name of output devices
notka56 [123]

Answer:

Monitor

Printer

Headphones

Computer Speakers

Projector

GPS

Sound Card

Video card

4 0
3 years ago
Read 2 more answers
Other questions:
  • In procedural programming, where does the flow of control usually route from the main function?
    8·1 answer
  • What is an advantage of using a meta-search engine?
    14·1 answer
  • Where is a 3D modeler most likely to work?
    6·1 answer
  • In this chapter, you subnetted a Class C private network into six subnets. In this project, you work with a Class B private netw
    10·1 answer
  • Matt is a senior developer for Cyber Protect, a company that helps secure management information systems. Matt's new task is to
    8·1 answer
  • Which of the following is NOT a safety practice for working near power lines?
    14·1 answer
  • Sally notices that she has the same set of 10 blocks in her code in multiple places. She decides to create a new block (procedur
    15·1 answer
  • High-level languages must be translated into machine language before they can be executed. _________________________
    10·1 answer
  • Select the correct answer.
    8·1 answer
  • Device drivers perform the actual communication between physical devices and the operating system. Group of answer choices True
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!