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
Lorico [155]
3 years ago
15

Given the char * variables name1, name2, and name3, write a fragment of code that assigns the largest value to the variable max

(assume all three have already been declared and have been assigned values).
Computers and Technology
1 answer:
Assoli18 [71]3 years ago
4 0

Answer:

The following code as follows:

Code:

max=name1;   //define variable max that holds name1 variable value.

if (strcmp(name2, max)>0)  //if block.

{

   max=name2;  //assign value to max.

}

if (strcmp(name3,max)>0)   //if block.

{

  max=name3; //assign value to max.

}

Explanation:

In the above code, we define a variable that is max. The data type of max variable is the same as variables "name1, name2, and name3" that is "char". In the max variable, we assign the value of the name1 variable and use if block statement two times. In if block, we use strcmp() function that can be defined as:

  • In first if block we pass two variables in strcmp() function that is "name2 and max" that compare string value. If the name2 variable is greater then max variable value so, the max variable value is change by name2 variable that is "max=name2".
  • In second if block we pass two variables in strcmp() function that is "name3 and max" that compare string value. If the name3 variable is greater then max variable value so, the max variable value is change by name3 variable that is "max=name3".

You might be interested in
William brought some data into his Tableau Book, but the data had some null values and incorrect column headers. What did Willia
ozzi

William  had to manually edit the data if he wants to remove the null values and incorrect column headers.

<h3>What is data editing?</h3>

Data editing is known to be a term that connote the act of making changes, reviewing or adjustment  some survey data.

Note that by editing one can remove want one do not want from a group of data and as such,  William  had to manually edit the data if he wants to remove the null values and incorrect column headers.

Learn more about data from

brainly.com/question/26711803

#SPJ1

6 0
2 years ago
A set of connected ideas supported by examples is ?
andrezito [222]

Answer:

Argument

Explanation:

<u>Argument</u> - A set of connected ideas, supported by examples, made by a writer to prove or disprove a point.

5 0
3 years ago
Read 2 more answers
Select the correct answer.
Veronika [31]
I think it’s c. llS....
6 0
3 years ago
Read 2 more answers
Choose the correct item. Check your answers in the text.<br>3​
RSB [31]

Answer:

You should do that

Explanation:

You didnt say anything

5 0
3 years ago
Which of the following expressions yields an integer between 0 and 100, inclusive? Question 5 options: (int)(Math.random() * 100
Alex17521 [72]

Answer:

(b) (int)(Math.random() * 101)

Explanation:

Given

min = 0 --- minimum

max =100 --- maximum

Required

Java expression to generate random integer between the above interval

The syntax to do this is:

(int)(Math.random((max - min) + 1) + min)

Substitute the values of max and min

(int)(Math.random((100 - 0) + 1) + 0)

Simplify the expression

(int)(Math.random(100 + 1) + 0)

(int)(Math.random(101) + 0)

(int)(Math.random(101))

Hence, the right option is:

(b) (int)(Math.random() * 101)

3 0
2 years ago
Other questions:
  • Vannevar bush imagined a desktop computing machine that would allow people to access data stored in various information centers
    10·1 answer
  • You are the manager and an employee shows up for his shift dressed inappropriately for work. What should you do?
    14·2 answers
  • How important is technology in education? what technology-related skills can you contribute to a school district answers?
    13·1 answer
  • It is an island country; it fought against us in World War II; it is known for sushi.
    14·2 answers
  • PLEASE ANSWER!! If my pixel has an RGB value of (R - 150, G - 0, B - 100), what is the dominant value? Why?
    14·1 answer
  • You manage a network that uses a single switch. All ports within your building connect through the single switch. In the lobby o
    14·1 answer
  • For a business that is properly using a social media information system, the system can
    13·1 answer
  • Help me please with this
    12·1 answer
  • Write a loop that continually asks the user what pets the user has until the user enters rock in which case the loop ends. It sh
    6·1 answer
  • Describe a new career in computer science that may be created in the future
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!