What will be the output of the following C# code? [code] static void Main(string[] args) { char A = 'K'; char B = Convert.ToChar(76)

Ngân Lam

New member
What will be the output of the following C# code?
Code:
 static void Main(string[] args)
 {
     char A = 'K';
     char B = Convert.ToChar(76);
     A++;
     B++;
     Console.WriteLine(A+ "  " +B);
     Console.ReadLine();
 }
A. M L
B. U L
C. L M
D. A B
 
Answer: c
Explanation: "++" increments the value of character by 1. A and B are given values K and 76, when we use increment operator their values increments by 1, A and B becomes L and M.
Output:
Code:
L, M.
 

Tìm kiếm

Back
Top