Home / Programs / Single-line comment at the end of a line of code in C#
Programming Example

Single-line comment at the end of a line of code in C#

👁 376 Views
💻 Practical Program
📘 Step by Step Learning
Single-line comment at the end of a line of code in C#

Program Code

using System;

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

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.