Given the string variables name1 and name2, write a fragment of code that assigns the larger of the two to the variable first (assume all three are already declared and name1 and name2 assigned values).
.
.
Click on the title for the solution
.
.
first=name1;
if (strcmp(name2,name1) > 0)
first=name2;
.
Click on the title for the solution
.
.
This is the answer:
:
first=name1;
if (strcmp(name2,name1) > 0)
first=name2;
Comments
Post a Comment