How to write multi-line comments in C#?


The comments that spread more than one line is called multi-line comments −

/* The following is a multi-line
Comment In C#
/*

The /*...*/ is ignored by the compiler and it is put to add comments in the program.

The following is a sample C# program showing how to add MULTI-line comments −

using System;

namespace Demo {
   class Program {
      static void Main(string[] args) {

         /* The following is a multi-line
         Comment In C#
         /*
         // printing
         Console.WriteLine("Hello World");
         Console.ReadKey();
      }
   }
}

Updated on: 20-Jun-2020

665 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements