Home / Programs / Single-line comment before a line of code in C#
Programming Example

Single-line comment before a line of code in C#

👁 381 Views
💻 Practical Program
📘 Step by Step Learning
Single-line comment before a line of code in C#

Program Code

using System;

namespace HelloWorld
{
  class Program
  {
    static void Main(string[] args)
    {
      // This is a comment
      Console.WriteLine("Hello World!");    
     }
  }
}

Output

Hello World!

Explanation

None

How to learn from this program

First read the algorithm, then study the program code line by line. After that, compare the code with the output and finally go through the explanation. This approach helps learners understand both the logic and the implementation properly.