Q2-2) Answer the following two questions for the code given below: public class Square { public static void Main() { int

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
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

Post by answerhappygod »

Q2 2 Answer The Following Two Questions For The Code Given Below Public Class Square Public Static Void Main Int 1
Q2 2 Answer The Following Two Questions For The Code Given Below Public Class Square Public Static Void Main Int 1 (22.67 KiB) Viewed 15 times
Q2-2) Answer the following two 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?
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply