Blog

Choose the output of following code when first input value is 2 and second is 5:

class Program {

static bool flag = true;
static int longitude = int.Parse(Console.ReadLine());
static int latitude = int.Parse(Console.ReadLine());

static Program(){

try{
if (longitude <= 0 || latitude <= 0){
flag = false;
throw new Exception(“longitude and latitude should be positive integer!”);
}
}catch (Exception e) {
Console.WriteLine(e);
}

}

static void Main(string[] args) {
Console.WriteLine(“longitude : ” + longitude + ” – latitude :” + latitude);
}

}