KEMBAR78
Comments in C Programming | PPT
COMMENTS
N.V.RAJA SEKHAR REDDY
WWW.PROGRAMMING9.COM
C-PROGRAMMING TUTORIALS
Comments in C
 Generally every programming language have
comments to maintain proper explanation
about the code.
 It is always a good idea to write comments for
the code to understand the logic behind the
statements.
2 www.programming9.com
Types of Comments
www.programming9.com3
 C language has two types of comments
1. Single Line Comments
//write here
2. Multi Line Comments
/*write here*/
Single Line Comments
www.programming9.com4
 Single line comments specially used for statement wise
explanation about the code.
Ex:
#include<stdio.h> // Standard I/O header file
int main() // C program starts from here
{
//code goes here
}
Multiline Comments
www.programming9.com5
Multi line comments are used for documentation at the beginning of the
code or where we need to place lengthy text that spans to multiple lines in
the program.
/* Comments in C Programming Language
Written by programming9.com */
 
#include<stdio.h>
int main()
{
/*
Multiple Lines of
code goes here
*/
}
Note:
www.programming9.com6
Comments with in comments
(Nested Comments) causes error.
www.programming9.com7
Please Like us @
www.facebook.com/programming9

Comments in C Programming