ExamVeda
Login
Home
File Handling and Input Output in C Sharp
?

What will be the output of the following C# 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();
}

Answer & Solution
Correct Answer: Option C
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.