porkshopp
Active member
How can I make this not output an error when a non-integer input is given?
C#:
using System;
namespace ConsoleApp3
{
class Program
{
static void Main(string[] args)
{
int a = Convert.ToInt16(Console.ReadLine());
if (a == 2 || a == 3) Console.WriteLine("Success!");
else Console.WriteLine("Failure!");
Main(null);
}
}
}