A comment is not a C# code and is ignored by the compiler. In C#, comment is necessary when we are dealing with lengthy sections of code, it can be useful to add reminders about exactly what we are doing. Comment indicates the purpose of the program so that others can also understand.
Types of comments:
class Program { static void Main(string[] args) { //Console.WriteLine("I'm learning C Programming"); //Console.WriteLine("I'm learning CPP Programming"); //Console.WriteLine("I'm learning Java Programming"); Console.WriteLine("I'm learning C#.Net Programming"); Console.ReadLine(); } }
class Program { static void Main(string[] args) { /*Console.WriteLine("I'm learning C Programming"); Console.WriteLine("I'm learning CPP Programming"); Console.WriteLine("I'm learning Java Programming");*/ Console.WriteLine("I'm learning C#.Net Programming"); Console.ReadLine(); } }