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
A user wants to quickly share pictures between mobile devices. The devices will be in close proximity so the necessity of a thir
BlackZzzverrR [31]

Answer:

NFC(Near Field Communication).

Explanation:

When user wants to share pictures quickly between the mobile devices which are in very close proximity we can use NFC(Near Field Communication).

Near Field Communication(NFC):-It is a group of communication protocols that lets two devices most of the times these are mobile phones to establish connection and the distance between them should be less around 4 centi meter.

8 0
4 years ago
If you want a language that is relatively easy to write and which can be tested easily as it's being developed, you would choose
Oksi-84 [34.3K]

Answer:

true

Explanation:

because it needs a interpreter so that it could be more developed

3 0
3 years ago
A main reason careers in Information Technology are growing faster than average is
Scorpion4ik [409]
Technology has become such a major part of everyday life
8 0
3 years ago
What does it mean to calculate frequencies within a dataset?
WITCHER [35]

Answer:

to count the number of cases that fall into different subgroups within a dataset.

Explanation:

To calculate the frequency within the dataset means to count the number of times that item or condition on which we are checking the column within the dataset is true or the frequency of the case that is coming into different subgroups.

Hence the answer of this question is third option given in the question.

8 0
3 years ago
Should you have a chance to participate in the design and implementation of a new Operating System, what course of action would
elena-s [515]

Answer:

Provide various open source services for users of the operating system.

Explanation:

Operating systems are applications that manages the computer hardware system. It creates a suitable platform for other user and system applications to run with access to the hardware features through a kernel.

The open source applications and services are user software applications that are free for users to customise and share with other users.

6 0
3 years ago
Other questions:
  • Background Susan finished work on system architecture issues, and her system design specification was approved. Now she is ready
    15·1 answer
  • The first graphical browser application for using the web was netscape. <br> a. True <br> b. False
    8·1 answer
  • You have a network of 300 users. You are finding that you must frequently restore files from backup that users have accidentally
    13·1 answer
  • In Microsoft Windows, which of the following typically happens by default when a file is "double-clicked"
    10·2 answers
  • Malware that corrupts the target operating system in such a manner that a network defender can no longer trust the native OS is
    15·1 answer
  • The set of communications rules for exchanging information electronically on the internet is called the ________.
    10·1 answer
  • Write a Python program that prints your name, CS classes taken (or other relevant experience), and the date on separate lines. U
    5·1 answer
  • design a relational database in EER for bike helmets and their reviews. a bike helmet has a name and color attributes. a bike co
    12·1 answer
  • How was the Big Ben project similar to the investigation you conducted in class to determine if the table was vibrating? How is
    7·1 answer
  • The rectangle shape in flowchart is used for
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!