Comments

Comments in C

Comments in C

Comments in C language are used to provide information about lines of code. It is widely used for documenting code. There are 2 types of comments in the C language.

  1. Single Line Comments
  2. Multi-Line Comments

Single Line Comments

Single line comments are represented by double slash \\. Let’s see an example of a single line comment in C.

#include
int main(){
//printing information
printf("Hello C");
return 0;
}        

Output:

Hello C

Even you can place the comment after the statement. For example:

printf"Hello C"//printing information

Multi Line Comments

Multi-Line comments are represented by slash asterisk \* … *\. It can occupy many lines of code, but it can’t be nested. Syntax:
/*code
to be commented
*/
Let’s see an example of a multi-Line comment in C.

#include
int main(){
/*printing information
Multi-Line Comment*/
printf("Hello C");
return 0;
} 

Output:

Hello C

Related Post

Switch Case Statement Switch Case Statement The switch statement is a multi-way branch statement. It provides an easy way to dispatch execution to different parts of c...
Navigation Tab Bar in IOS | Swift tutorial Navigation Tab Bar in IOS | Swift tutorial Different Customizing techniques for Navigation bar with storyboard and code 1) Custom NavigationTabBar b...
Use of CollectionViewDataSource method moveItemAt ... Use of CollectionViewDataSource method moveItemAt for Reordering CollectionView cell In IOS (Swift 4) In this tutorial we are study about how we can ...
First Java Program First Java Program NOTE: You need to have java installed on your system. Step 1: Open a text editor, like Notepad on windows and TextEdit on Mac. W...
Drag and Drop Collection View cell in IOS 11 &... Drag and Drop Collection View cell in IOS 11 & swift 4 In this tutorial we are explain how to drag and drop collection view cell in two collectio...
Data Type And Storage And Keywords To store data inside the computer we need to first identify the type of data elements we need in our program. There are several different types of dat...

Leave a Reply

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

Get more stuff like this
in your inbox

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.