Comments in C Programming

2,240 views 7 slides May 21, 2014
Slide 1
Slide 1 of 7
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7

About This Presentation

This PPT is for the beginners of c programming. It explains Single Line and MUlti Line Comments,


Slide Content

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