C# Comments Tutorial with Examples

C# Comments Tutorial with Examples

Today, We want to share with you C# Comments Tutorial with Examples.
In this post we will show you C# Comments, hear for c# comments best practices we will give you demo and example for implement.
In this post, we will learn about C# Programming/Syntax with an example.

My Paka Knowledgeable Ideas, Tips and Tricks, Useful Content, Jobs, Technology, Earn Money, gmail creation, skype, yahoo and more useful things.

Introduction: C# Comments

In this post, we will learn about C# Comments C#.Net with an example.

Read Also:  AngularJS Fancybox Popup Simple Example

The C# comments are statements or lines of code that are not executed by the compiler. The comments in C# programming are used to provide explanation of the code, variable, method, logic of codes or class.

There are two types of comments in C#.

  • Single Line comment
  • Multi Line comment

C# Single Line Comment

The single line comment starts with // (double slash). Let’s see an example of single line comment in C#.

Read Also:  react open new tab on button click

using System;  
   public class CommentDemo  
    {  
       public static void Main(string[] args)  
        {  
            int _max = 15;//Here,is max variable 
            Console.WriteLine(x);  
            Console.ReadLine();
        }  
    }  

C# Multi Line Comment

The C# multi line comment is used to comment more than one line of code. It is surrounded by slash and asterisk (/* ….. */). Let’s see an example of multi line comment in C#.

using System;  
   public class CommentExample  
    {  
       public static void Main(string[] args)  
        {  
            /* Let's declare and  
          print variable in C#. This is multi line comment */   
            int x=20;  
            Console.WriteLine(x);  
        }  
    }  

Read :

Read Also:  Golang Float64s function - Math function

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about How to comment multiple lines with space or indent in C#.I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.


Related FAQ

Here are some more FAQ related to this Article:

  1. Read Also:  Jquery .next() and .prev() functions example
  2. Read Also:  Laravel 6 change date format example Tutorial
  3. Read Also:  PHP Toggle Like Dislike Rating System using jQuery Ajax
  4. Read Also:  Ajax Dynamic Dependent Dropdown using Laravel Example
  5. Read Also:  how to run codeigniter project in xampp
  6. Read Also:  how to get every question right on ixl
  7. Read Also:  WooCommerce Get Product Dimensions
  8. Read Also:  WooCommerce Get Product Dimensions
  9. Read Also:  Golang Float64s function - Math function
  10. Read Also:  Ajax Dynamic Dependent Dropdown using Laravel Example
CLOSEX