Variables in C Programming

programming9 13,166 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 beginners of C Programming. It explains Variables concept in c.


Slide Content

C-Programming Tutorials
N.V.Raja Sekhar Reddy
www.programming9.com
VARIABLES
1 www.programming9.com

Variables in C
Variables are names used to refer to some memory
locations of computer.
The piece of information stored at this location is
referred as value of a variable.
The variables are not fixed values and might change
during the execution of a program.
2 www.programming9.com

Syntax to declare a variable
Syntax:
Datatype Variablename;
int d;
float a,b;
double f;
char ch; etc.,
3 www.programming9.com

Defining a Variable
int a=10, b=20;
float f=23.145;
double d=20.0;
char ch='x';
4 www.programming9.com

In RAM (Physical Memory)
5 www.programming9.com

Rules for using Variables
The variable name can contain letters, digits and the
underscore ( _) .
 The first character of the variable name must be a letter
or underscore ( _).
 Variable name must not be the same as C reserved
words or keywords.
It should not contain white spaces.
6 www.programming9.com

Brought You By

www.programming9.com
7 www.programming9.com