Completed the program to find the max among a given limit of number