How to use comments in C# source code?

Below code shows how to add comments to c#/csharp source code

using System;

namespace kodehelp.csharp.basic
{
    class CommentSample
    {
        public static void Main(string[] args)
        {
            // Assign name as kodehelp.
            String name = "Vigilance"; // This is a single line comment.
            Console.WriteLine("Name: " + name);

            /*
             * A multiline comments.
             * This is example of multiline comment
             *.
             */
            foreach (string arg in args) {
               Console.WriteLine("Argument: " + arg);
            }
        }
     }
}

Please Post Your Comments & Reviews

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.