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

Create UITableView (Table View) By the use of stor... How to use UITableView in Above IOS 8 and Swift (UITableView) In this tutorial we are study how to use the TableView in Swift. One of the most common...
Firebase Push notification | Swift tutorial Push Notification by firebase in IOS.For Firebase Push notification we need to have paid apple developer account. You need to Enroll into the Apple D...
Introduction to JVM Introduction to JVM JVM stands for Java Virtual Machine. It works as an engine that derives the Java Code. The JVM does not understand Java ty...
Java Operators Java Operators An operator is used to perform an operation over one or more operands. It is a character that represents an action, for example * is a...
Asset Color Catalog | Swift Tutorial Asset Color Catalog is the feature of XCode 9. BY the use of this feature we can maintain the colors easily and avoid the mistakes. We can create the ...
New features in XCode 10 Supported Configurations Xcode 10 beta requires a Mac running macOS 10.13.4 or later Xcode 10 beta includes SDKs for iOS 12, watchOS 5, macOS ...

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.