In this tutorial, we'll learn how to use comments with single line, multi-line. The comment in the program to skip certain statements from execution in C#.
The purpose of making the source code easier for humans to understand used comment. Comments are brief descriptions of the logic and workings of the written code in C#. Comments are descriptions in the C# code that help users better understand the intent and functionality of the C# Code.
There are two types of comments in C#: single-line comments and multi-line comments.
Single-line comments start with two forward slashes // and continue until the end of the line.
// This is a single-line comment int x = 56; // This is also a single-line comment
Multi-line comments start with /* and end with */. Everything between these two characters is treated as a comment.
/* This is a multi-line comment. It can span multiple lines. */ int y = 88;