The logic for finding out the largest of 3 numbers is :
Here are using 2 if loops for comparing the variable. The first loop is used to compare the value of the variable max & second,here if max is smaller than second then the max will becomes equal to second. The another if loop is used to check whether the variable max is smaller than third or not, if yes then max will becomes equal to the value of the third variable. Finally we get out MAXIMUM number which should be stored in the variable max.