/**
 * Explanation: This function finds the largest number among three given inputs, a, b, and c.
 * You need to complete the code using an alternative approach to the ternary operator and handle any possible errors.
 *
 * @param a First input number
 * @param b Second input number
 * @param c Third input number
 * @return The largest number among a, b, and c
 */
fun findLargestNumber(a: Int, b: Int, c: Int): Int {

    var largest: Int

    try {
        // Identifying the largest number using an alternative approach to ternary operator
        largest = if (a > b && a > c) {
            a
        } else if (b > c) {
            b
        } else {
            c
        }

        return largest
    } catch (e: ClassCastException) {
        // Handle type error if any of the inputs are not integers
        throw IllegalArgumentException("Invalid inputs. Please provide integers only.")
    } catch (e: Exception) {
        // Handle any other potential errors
        throw Exception("An unexpected error occurred.")
    }
}
/**
 * Explanation: This function finds the largest number among three given inputs, a, b, and c.
 * You need to complete the code using an alternative approach to the ternary operator and handle any possible errors.
 *
 * @param a First input number
 * @param b Second input number
 * @param c Third input number
 * @return The largest number among a, b, and c
 */
fun findLargestNumber(a: Int, b: Int, c: Int): Int {
/**
 * Explanation: This function finds the largest number among three given inputs, a, b, and c.
 * You need to complete the code using an alternative approach to the ternary operator and handle any possible errors.
 *
 * @param a First input number
 * @param b Second input number
 * @param c Third input number
 * @return The largest number among a, b, and c
 */
fun findLargestNumber(a: Int, b: Int, c: Int): Int {

    var largest: Int

    try {
        // Identifying the largest number using an alternative approach to ternary operator
        largest = if (a > b && a > c) {
            a
        } else if (b > c) {
            b
        } else {
            c
        }

        return largest
    } catch (e: ClassCastException) {
        // Handle type error if any of the inputs are not integers
        throw IllegalArgumentException("Invalid inputs. Please provide integers only.")
    } catch (e: Exception) {
        // Handle any other potential errors
        throw Exception("An unexpected error occurred.")
    }
}