What will be the result of the following code execution?
 
namespace ConsoleApplication1 
{ 
     class Program 
     { 
         static void Main(string[] args) 
         {
             string @string = "ABC";   
             Console.WriteLine(string); 

             Console.ReadLine(); 
         } 
     }
}
 
Explanation
In Console.WriteLine we try to print the type instead of a local variable. In order to print the local variable, it should be called in the following way: @string.

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
C# quizzes
Cosmo
Sign Up Now
or Subscribe for future quizzes