1.

Choose the output for the following set of code? static void Main(string[] args) { Console.WriteLine("This is a Console Application:"); Console.Write("Please enter your lucky number:"); string val1 = Console.ReadLine(); int val2 = System.Convert.ToInt32(val1, 10); val2 = val2 * val2; Console.WriteLine("square of number is:" +val2); Console.Read(); }

A. Compile time error
B. Runs successfully does not print anything
C. Runs successfully, ask for input and hence displays the result
D. Syntax Error
Answer» D. Syntax Error


Discussion

No Comment Found