skipter icon

Try- Catch

skipter | PRO | 09/21/17 06:25:53 PM UTC | 0 ⭐ | 348 👁️ | Never ⏰ | []
C# |

390 B

|

None

|

0 👍

/

0 👎

namespace NumberChecker
{
    using System;
    public class Program
    {
        static void Main()
        {
            try
            {
                var word = int.Parse(Console.ReadLine());
                Console.WriteLine("It is a number.");
            }
            catch
            {
                Console.WriteLine("Invalid input!");
            }
        }
    }
}

Comments