SlideShare una empresa de Scribd logo
1 de 7
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

Más contenido relacionado

La actualidad más candente

Presentation on Function in C Programming
Presentation on Function in C ProgrammingPresentation on Function in C Programming
Presentation on Function in C ProgrammingShuvongkor Barman
 
What is keyword in c programming
What is keyword in c programmingWhat is keyword in c programming
What is keyword in c programmingRumman Ansari
 
Type casting in c programming
Type casting in c programmingType casting in c programming
Type casting in c programmingRumman Ansari
 
data types in C programming
data types in C programmingdata types in C programming
data types in C programmingHarshita Yadav
 
Variables in C++, data types in c++
Variables in C++, data types in c++Variables in C++, data types in c++
Variables in C++, data types in c++Neeru Mittal
 
Conditional Statement in C Language
Conditional Statement in C LanguageConditional Statement in C Language
Conditional Statement in C LanguageShaina Arora
 
Programming in C Presentation upto FILE
Programming in C Presentation upto FILEProgramming in C Presentation upto FILE
Programming in C Presentation upto FILEDipta Saha
 
Java Data Types
Java Data TypesJava Data Types
Java Data TypesSpotle.ai
 
structure and union
structure and unionstructure and union
structure and unionstudent
 
Basics of C programming
Basics of C programmingBasics of C programming
Basics of C programmingavikdhupar
 
Data types in C language
Data types in C languageData types in C language
Data types in C languagekashyap399
 

La actualidad más candente (20)

Data types in C
Data types in CData types in C
Data types in C
 
Presentation on Function in C Programming
Presentation on Function in C ProgrammingPresentation on Function in C Programming
Presentation on Function in C Programming
 
What is keyword in c programming
What is keyword in c programmingWhat is keyword in c programming
What is keyword in c programming
 
Type casting in c programming
Type casting in c programmingType casting in c programming
Type casting in c programming
 
data types in C programming
data types in C programmingdata types in C programming
data types in C programming
 
Control statements in c
Control statements in cControl statements in c
Control statements in c
 
C language ppt
C language pptC language ppt
C language ppt
 
Variables in C++, data types in c++
Variables in C++, data types in c++Variables in C++, data types in c++
Variables in C++, data types in c++
 
Conditional Statement in C Language
Conditional Statement in C LanguageConditional Statement in C Language
Conditional Statement in C Language
 
Structure in C
Structure in CStructure in C
Structure in C
 
Programming in C Presentation upto FILE
Programming in C Presentation upto FILEProgramming in C Presentation upto FILE
Programming in C Presentation upto FILE
 
Identifiers
Identifiers Identifiers
Identifiers
 
Java Data Types
Java Data TypesJava Data Types
Java Data Types
 
structure and union
structure and unionstructure and union
structure and union
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
 
Structure of a C program
Structure of a C programStructure of a C program
Structure of a C program
 
Basics of C programming
Basics of C programmingBasics of C programming
Basics of C programming
 
Data types in C language
Data types in C languageData types in C language
Data types in C language
 
Array in c
Array in cArray in c
Array in c
 
Storage class in C Language
Storage class in C LanguageStorage class in C Language
Storage class in C Language
 

Destacado

datatypes and variables in c language
 datatypes and variables in c language datatypes and variables in c language
datatypes and variables in c languageRai University
 
constants, variables and datatypes in C
constants, variables and datatypes in Cconstants, variables and datatypes in C
constants, variables and datatypes in CSahithi Naraparaju
 
INTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGINTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGAbhishek Dwivedi
 
Programming in c
Programming in cProgramming in c
Programming in cedudivya
 
TD-666-01-teknik-pemrograman
TD-666-01-teknik-pemrogramanTD-666-01-teknik-pemrograman
TD-666-01-teknik-pemrogramanTino Dwiantoro
 
Variables in C and C++ Language
Variables in C and C++ LanguageVariables in C and C++ Language
Variables in C and C++ LanguageWay2itech
 
Pt 2 matriks1-rev
Pt 2 matriks1-revPt 2 matriks1-rev
Pt 2 matriks1-revlecturer
 
Belajar netbeans java pemula dari 0 sampai mahir
Belajar netbeans java pemula dari 0 sampai mahirBelajar netbeans java pemula dari 0 sampai mahir
Belajar netbeans java pemula dari 0 sampai mahirharisonmtd
 

Destacado (13)

datatypes and variables in c language
 datatypes and variables in c language datatypes and variables in c language
datatypes and variables in c language
 
constants, variables and datatypes in C
constants, variables and datatypes in Cconstants, variables and datatypes in C
constants, variables and datatypes in C
 
INTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGINTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMING
 
Programming in c
Programming in cProgramming in c
Programming in c
 
TD-666-01-teknik-pemrograman
TD-666-01-teknik-pemrogramanTD-666-01-teknik-pemrograman
TD-666-01-teknik-pemrograman
 
Chap 2 c++
Chap 2 c++Chap 2 c++
Chap 2 c++
 
Analisa matriks
Analisa matriksAnalisa matriks
Analisa matriks
 
Mat.01.matrik
Mat.01.matrikMat.01.matrik
Mat.01.matrik
 
Variables in C and C++ Language
Variables in C and C++ LanguageVariables in C and C++ Language
Variables in C and C++ Language
 
Pt 2 matriks1-rev
Pt 2 matriks1-revPt 2 matriks1-rev
Pt 2 matriks1-rev
 
Programming in c++
Programming in c++Programming in c++
Programming in c++
 
Belajar netbeans java pemula dari 0 sampai mahir
Belajar netbeans java pemula dari 0 sampai mahirBelajar netbeans java pemula dari 0 sampai mahir
Belajar netbeans java pemula dari 0 sampai mahir
 
C ppt
C pptC ppt
C ppt
 

Similar a Variables in C Programming

Computer programming(CP)
Computer programming(CP)Computer programming(CP)
Computer programming(CP)nmahi96
 
Programming construction tools
Programming construction toolsProgramming construction tools
Programming construction toolssunilchute1
 
C language variables
C language variablesC language variables
C language variablesmarar hina
 
2. introduction of a c program
2. introduction of a c program2. introduction of a c program
2. introduction of a c programAlamgir Hossain
 
C Language Interview Questions: Data Types, Pointers, Data Structures, Memory...
C Language Interview Questions: Data Types, Pointers, Data Structures, Memory...C Language Interview Questions: Data Types, Pointers, Data Structures, Memory...
C Language Interview Questions: Data Types, Pointers, Data Structures, Memory...Rowank2
 
Interview Questions For C Language .pptx
Interview Questions For C Language .pptxInterview Questions For C Language .pptx
Interview Questions For C Language .pptxRowank2
 
unit 1 cpds.pptx
unit 1 cpds.pptxunit 1 cpds.pptx
unit 1 cpds.pptxmadhurij54
 
Interview Questions For C Language
Interview Questions For C Language Interview Questions For C Language
Interview Questions For C Language Rowank2
 
Introduction to Programming Fundamentals 3.pdf
Introduction to Programming Fundamentals 3.pdfIntroduction to Programming Fundamentals 3.pdf
Introduction to Programming Fundamentals 3.pdfAbrehamKassa
 
C_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptxC_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptxLikhil181
 
C programming tutorial
C programming tutorialC programming tutorial
C programming tutorialMohit Saini
 
C-PROGRAMMING.pdf
C-PROGRAMMING.pdfC-PROGRAMMING.pdf
C-PROGRAMMING.pdfTushalJain3
 

Similar a Variables in C Programming (20)

Computer programming(CP)
Computer programming(CP)Computer programming(CP)
Computer programming(CP)
 
5 introduction-to-c
5 introduction-to-c5 introduction-to-c
5 introduction-to-c
 
Unit 2- Module 2.pptx
Unit 2- Module 2.pptxUnit 2- Module 2.pptx
Unit 2- Module 2.pptx
 
C programming
C programmingC programming
C programming
 
C programming
C programmingC programming
C programming
 
Programming construction tools
Programming construction toolsProgramming construction tools
Programming construction tools
 
C language variables
C language variablesC language variables
C language variables
 
CProgrammingTutorial
CProgrammingTutorialCProgrammingTutorial
CProgrammingTutorial
 
2. introduction of a c program
2. introduction of a c program2. introduction of a c program
2. introduction of a c program
 
C Language Interview Questions: Data Types, Pointers, Data Structures, Memory...
C Language Interview Questions: Data Types, Pointers, Data Structures, Memory...C Language Interview Questions: Data Types, Pointers, Data Structures, Memory...
C Language Interview Questions: Data Types, Pointers, Data Structures, Memory...
 
Interview Questions For C Language .pptx
Interview Questions For C Language .pptxInterview Questions For C Language .pptx
Interview Questions For C Language .pptx
 
Introduction%20C.pptx
Introduction%20C.pptxIntroduction%20C.pptx
Introduction%20C.pptx
 
unit 1 cpds.pptx
unit 1 cpds.pptxunit 1 cpds.pptx
unit 1 cpds.pptx
 
PSPC--UNIT-2.pdf
PSPC--UNIT-2.pdfPSPC--UNIT-2.pdf
PSPC--UNIT-2.pdf
 
Interview Questions For C Language
Interview Questions For C Language Interview Questions For C Language
Interview Questions For C Language
 
Introduction to Programming Fundamentals 3.pdf
Introduction to Programming Fundamentals 3.pdfIntroduction to Programming Fundamentals 3.pdf
Introduction to Programming Fundamentals 3.pdf
 
C_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptxC_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptx
 
C
CC
C
 
C programming tutorial
C programming tutorialC programming tutorial
C programming tutorial
 
C-PROGRAMMING.pdf
C-PROGRAMMING.pdfC-PROGRAMMING.pdf
C-PROGRAMMING.pdf
 

Último

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 

Último (20)

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 

Variables in C Programming

  • 1. C-Programming Tutorials N.V.Raja Sekhar Reddy www.programming9.com VARIABLES 1 www.programming9.com
  • 2. 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
  • 3. Syntax to declare a variable  Syntax: Datatype Variablename; int d; float a,b; double f; char ch; etc., 3 www.programming9.com
  • 4. Defining a Variable int a=10, b=20; float f=23.145; double d=20.0; char ch='x'; 4 www.programming9.com
  • 5. In RAM (Physical Memory) 5 www.programming9.com
  • 6. 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