Hello
I have a question about Re-Entering Try Catch
Thank you
I have a question about Re-Entering Try Catch
C#:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
int iNum1;
int iNum2;
while (true)
{
try
{
Console.WriteLine("1) Please Input Integer ----1");
iNum1 = int.Parse(Console.ReadLine());
Console.WriteLine("2) Please Input Integer ----2");
iNum2 = int.Parse(Console.ReadLine());
break;
}
catch (Exception)
{
Console.WriteLine("An integer was not entered");
}
}
}
}
}
Thank you