public static void Main()
Console.WriteLine("Time Elapsed.");
Console.Write("Enter time in hour(s): ");
hours = Console.ReadLine();
if (Int32.TryParse(hours, out h) == true)
Console.WriteLine("Input Error. Hours value should be 0-24 only.");
Console.WriteLine("The equivalent time in seconds is {0:#,00}", totaltime);
Console.Write("Enter time in minute(s): ");
minutes = Console.ReadLine();
if (Int32.TryParse(minutes, out m) == true)
Console.WriteLine("Input Error. Minutes value should be 0-60 only.");
totaltime = (h * 60 * 60) + (m * 60);
Console.WriteLine("The equivalent time in seconds is {0:#,00}", totaltime);
Console.Write("Enter time in second(s): ");
seconds = Console.ReadLine();
if (Int32.TryParse(seconds, out s) == true)
Console.WriteLine("Input Error. Seconds value should be 0-60 only.");
totaltime = (h * 60 * 60) + (m * 60) + (s);
Console.WriteLine("The equivalent time in seconds is {0:#,00}", totaltime);
Console.WriteLine("Invalid Input. PLease input a numeric.");
Console.WriteLine("Invalid Input. PLease input a numeric.");
Console.WriteLine("Invalid Input. PLease input a numeric.");
Console.Write("Do you want to try again? Y/y ");
answer = Console.ReadLine();
} while (answer == "Y" || answer == "y");
Console.Write("End of Program. Press any key to exit. ");