Let us consider that there are 3 variables “first” to store the content of variable whose value is larger as per the given example in the question, a variable called “name1” to get the first string and “name 2” to get second string. We must run a simple for loop to achieve the result.
if name1>name2
first =name1
else
first=name2
So here like numbers, strings are checked to find which is largest and assigns accordingly. Thus the task is accomplished.