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]
3 years ago
7

2.8 Code Practice: Question 1

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

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

Output: Largest number = 8

-BARSIC- [3]3 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
Create a class called Jack that extends Leo. This class must have the following behaviors/methods. You must use the inheritance
lara [203]

Answer:

public class Leo{

public String method1(){

return "Jack 1 Leo 1";

}

public String method2(){

return "Don 2 Jack 2";

}

public String method3(){

return "Jack 3 Leo 3 Don 2";

}

public String toString(){

return "Jack 3 Leo 1"

}

}

public class Jack extends Leo{

}

Explanation:

Leo is the parent class and jack inherits all of its attributes from Leo

So when you call the following code in the main method:

Jack j = new Jack();

System.out.println(j.method1);

it should print Jack 1 Leo 1

This is because the program first checks if method 1 exists in the Jack class

Because it doesn't exist it then goes to the parent class which is Leo.

And in the Leo class method1 displays "Jack 1 Leo 1 "

So it prints that

8 0
3 years ago
Hard disk is a sequential data access medium. true or false?​
Crazy boy [7]

My answer is TRUE

Explanation:

Hope it help!!

3 0
3 years ago
Please!! I need help, this is due by tonight!!!
lyudmila [28]

Answer:

sorry if it is too late but I think it is d

Explanation:

4 0
3 years ago
You are working the 8:00 AM shift at the help desk. An irate user who fails to identify himself calls in claiming that his works
WARRIOR [948]

Answer:

Calmly ask him for his name and a more detailed explanation of the problem.

Explanation:

Since in the question,  it is mentioned that the anger use who fails to identify himself and claim that his workstation is malfunctioning and want to fix it now

Now the action which would be taken is to ask his name in a calmy manner and understand what the actually problem he is suffering by understanding it in a detailed way

Therefore according to the given case, the correct option is d.

3 0
3 years ago
If AX contains hex information 2111 and BX contains hex information 4333, what is the content in BX in hex format after performi
il63 [147K]

Answer:

BX will hold 6444 in hex format.

Explanation:

From the given information:

We need to understand that AX is 64-bit hex number.

When performing ASM instruction (Assembly language instruction),

The addition of 2111 + 4333 = 6444 will be in BX.

This is because ADD, BX, AX will add bx and ax; and the final outcome will be stored in BX.

∴

BX will hold 6444 in hex format.

7 0
2 years ago
Other questions:
  • What port number is the web server listening on for the web request?
    9·1 answer
  • While working a night job at a call center, Eric creates an app called EatOut, which can be used to place orders at restaurants,
    14·1 answer
  • Which of the following controls will provide an area in the form for the user to enter a name? a. button b. label c. text box d.
    8·1 answer
  • Which technology is predominately used for contactless payment systems?
    11·1 answer
  • knowledge contributes vitally to the development of __________ memory, or recollections of personally experienced events that oc
    12·1 answer
  • What number system do people in America use?
    10·2 answers
  • What section in an ethernet frame will you find a Virtual Local Area Network (VLAN) header?
    6·1 answer
  • A a a a I don't need help!?
    13·1 answer
  • true or false You are able to change the formatting of a table after it is inserted into a placeholder.
    6·1 answer
  • What are the two compatibility issues that may arise between computer systems while transferring presentations? different video
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!