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: