Q2-2) Answer the following two questions for the code given below: public class Square { public static void Main() { int
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Q2-2) Answer the following two questions for the code given below: public class Square { public static void Main() { int
questions for the code given below: public class Square { public static void Main() { int num; string inputString: Console.WriteLine("Enter an integer"); inputString = Console.ReadLine(); num= Convert.Tolnt32(inputString); SquareVal(num); } public static void SquareVal(int x) ( int temp = x * x; Console.WriteLine("The squared of (0) is {1}", x, temp); } } a) Explain the code b) What is the output of the code if the user enters 4?
Q2-2) Answer the following two