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
The user cannot use a computer system without.................... software<br><br>​
zheka24 [161]

Answer:

the user cannot use a computer system without hardware and software

4 0
3 years ago
Read 2 more answers
Renter’s insurance is not necessary if you don’t have a lot of expensive things.
attashe74 [19]

Wrong, You should get renters insurance to insure your items that you do have or will recieve in the future are safe

7 0
3 years ago
An online retailer has developed an algorithm to provide personalized recommendations to shoppers. Which form of IPR protects th
Helen [10]

Answer:

should be B.

Explanation:

If not then Im sorry

5 0
2 years ago
What are new technologies, products, or services that eventually surpass the existing dominant technology or product in a market
kicyunya [14]

Answer:

Disruptive innovation

Explanation:

Disruptive innovation are considered those new technologies, products or services whose application can greatly impact the manner in which an industry or a market functions. This is because the surpass the existing dominant product or technology. One example of a disruptive innovation is the internet. The internet altered the manner in which business was done by companies, but negatively affected those who refused to adopt it.

4 0
3 years ago
Where is the Outlook Search Folder located?
melamori03 [73]
When you go to the mail go to file and click new it should be in there as search folder
6 0
3 years ago
Other questions:
  • What do work places allow a company to do
    12·1 answer
  • This provides an easy method for workers to use their computers.
    11·2 answers
  • Arrays are described as immutable because they are two dimensional. are arranged sequentially. can be reordered. cannot be chang
    11·1 answer
  • If an author is creating a reference list and wants the second and succeeding lines indented for a reference, they should select
    13·2 answers
  • Why is the most important factor for investors always the quality of the venture's leadership team
    12·1 answer
  • Integer indexing array: Weekend box office The row array movieBoxOffice stores the amount of money a movie makes (in millions of
    11·1 answer
  • Tom and his brother caught 100 finish on a weeklong fishing trip. The total way of the fish was 235 pounds. What is the weight o
    9·1 answer
  • Your computer uses 4 bits to represent decimal numbers (0, 1, 2, 3 and so on) in binary. What is the SMALLEST number for which a
    8·1 answer
  • I really want to know the best way to deal as much heart as possible plz tell me
    7·2 answers
  • What does a hanging indent look like?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!