Dinesh Kudale

Dinesh Kudale

  • 1.6k
  • 127
  • 17.7k

Why output contain 'D' in C# program of ReadKey() ?

Jun 15 2019 1:04 AM

 

  1. using System;  
  2. using System.Collections.Generic;  
  3. using System.Text;  
  4.   
  5. namespace CSharp5  
  6. {  
  7.     class Class3  
  8.     {  
  9.         static void Main()  
  10.         {  
  11.             ConsoleKeyInfo m = Console.ReadKey();  
  12.             Console.WriteLine("\n" + m.Key);  
  13.         }  
  14.     }  
  15. }  

 
In Output screen, When I press 2, then it print D2. 
Why It prints D before output?
 

Answers (2)