SlideShare a Scribd company logo
Notes on
Variable & Constant
Instructor:
Arghodeep Paul
Firmware Engineer at BitBible Technologies Pvt. Ltd.
Content Author: Arghodeep Paul
License: OpenSource
Date: 14 July 2021
Variable
A Variable is nothing but a name given to a Memory location. That Memory Location
belongs to Primary Storage(RAM) or in CPU registers. Variables are created of a
specific Data Type.
Syntax
int number; // declaration of a int type variable
number=3; // initialization of the value
Or
int number=3; // declaration and initialization together
Constant
Same as the variable but the only difference is you can not change the Value after it
has been initialized.
Syntax
#define PI 3.14 //no equal sign no semicolon
Or
const float PI=3.14;
Note: Constant identifiers are written in CAPITAL as a convention.

More Related Content

PDF
Lecture 2 keyword of C Programming Language
SURAJ KUMAR
 
ODP
Gentle Introduction To Funcitonal Programming - Detroit.Code
OnorioCatenacci
 
PDF
Doppl development iteration #7
Diego Perini
 
PPT
25 bnf
kalyan krishna
 
PDF
Doppl development iteration #4
Diego Perini
 
PPT
Normalization
Urooj Sabar
 
DOCX
Programming in c plus plus3
AA Coaching Academy
 
PPTX
What is keyword in c programming
Rumman Ansari
 
Lecture 2 keyword of C Programming Language
SURAJ KUMAR
 
Gentle Introduction To Funcitonal Programming - Detroit.Code
OnorioCatenacci
 
Doppl development iteration #7
Diego Perini
 
Doppl development iteration #4
Diego Perini
 
Normalization
Urooj Sabar
 
Programming in c plus plus3
AA Coaching Academy
 
What is keyword in c programming
Rumman Ansari
 

What's hot (18)

PDF
How keywords and reserved words differ?
Ajay Chimmani
 
PPTX
Latest trends in NLP - Exploring BERT
Silversparro Technologies
 
PPTX
Decision and looping examples with php (WT)
kunjan shah
 
PPTX
Python decision making_loops part6
Vishal Dutt
 
DOCX
Complete c programming presentation
nadim akber
 
ODP
Convention-Based Syntactic Descriptions
Ray Toal
 
PDF
07 -pointers_and_memory_alloc
Hector Garzo
 
PDF
C#(VB)プログラマのためのF#入門
bleis tift
 
PDF
Learn C# Programming - Decision Making & Loops
Eng Teong Cheah
 
PPTX
Equivalence of pda, cfg1
Dr. ABHISHEK K PANDEY
 
DOCX
C# note
Dr. Somnath Sinha
 
PDF
Lesson 02 python keywords and identifiers
Nilimesh Halder
 
PPT
Welcome to lecture 4 in c programming
umair ansari
 
ODP
CProgrammingTutorial
Muthuselvam RS
 
PPTX
NLP State of the Art | BERT
shaurya uppal
 
DOCX
Python Programming Language
StefanoTermini3
 
PDF
All meta languages
mary_ramsay
 
PPTX
Computational model language and grammar bnf
Taha Shakeel
 
How keywords and reserved words differ?
Ajay Chimmani
 
Latest trends in NLP - Exploring BERT
Silversparro Technologies
 
Decision and looping examples with php (WT)
kunjan shah
 
Python decision making_loops part6
Vishal Dutt
 
Complete c programming presentation
nadim akber
 
Convention-Based Syntactic Descriptions
Ray Toal
 
07 -pointers_and_memory_alloc
Hector Garzo
 
C#(VB)プログラマのためのF#入門
bleis tift
 
Learn C# Programming - Decision Making & Loops
Eng Teong Cheah
 
Equivalence of pda, cfg1
Dr. ABHISHEK K PANDEY
 
Lesson 02 python keywords and identifiers
Nilimesh Halder
 
Welcome to lecture 4 in c programming
umair ansari
 
CProgrammingTutorial
Muthuselvam RS
 
NLP State of the Art | BERT
shaurya uppal
 
Python Programming Language
StefanoTermini3
 
All meta languages
mary_ramsay
 
Computational model language and grammar bnf
Taha Shakeel
 
Ad

More from ArghodeepPaul (12)

PDF
Microprocessor questions converted
ArghodeepPaul
 
PDF
Windows script host
ArghodeepPaul
 
PDF
Windows batch scripting
ArghodeepPaul
 
PDF
Common problems solving using c
ArghodeepPaul
 
PDF
C operators
ArghodeepPaul
 
PDF
C taking user input
ArghodeepPaul
 
PDF
C storage classes
ArghodeepPaul
 
PDF
C datatypes
ArghodeepPaul
 
PDF
C program structure
ArghodeepPaul
 
PDF
Computer programming tools and building process
ArghodeepPaul
 
PDF
Algorithm pseudocode flowchart program notes
ArghodeepPaul
 
PDF
notes on Programming fundamentals
ArghodeepPaul
 
Microprocessor questions converted
ArghodeepPaul
 
Windows script host
ArghodeepPaul
 
Windows batch scripting
ArghodeepPaul
 
Common problems solving using c
ArghodeepPaul
 
C operators
ArghodeepPaul
 
C taking user input
ArghodeepPaul
 
C storage classes
ArghodeepPaul
 
C datatypes
ArghodeepPaul
 
C program structure
ArghodeepPaul
 
Computer programming tools and building process
ArghodeepPaul
 
Algorithm pseudocode flowchart program notes
ArghodeepPaul
 
notes on Programming fundamentals
ArghodeepPaul
 
Ad

Recently uploaded (20)

PDF
Software Testing Tools - names and explanation
shruti533256
 
PDF
2010_Book_EnvironmentalBioengineering (1).pdf
EmilianoRodriguezTll
 
PPTX
Fluid Mechanics, Module 3: Basics of Fluid Mechanics
Dr. Rahul Kumar
 
PPTX
ANIMAL INTERVENTION WARNING SYSTEM (4).pptx
dodultrongaming
 
PPTX
Simulation of electric circuit laws using tinkercad.pptx
VidhyaH3
 
PPTX
Edge to Cloud Protocol HTTP WEBSOCKET MQTT-SN MQTT.pptx
dhanashri894551
 
PDF
6th International Conference on Artificial Intelligence and Machine Learning ...
gerogepatton
 
PDF
July 2025: Top 10 Read Articles Advanced Information Technology
ijait
 
PDF
dse_final_merit_2025_26 gtgfffffcjjjuuyy
rushabhjain127
 
PDF
Traditional Exams vs Continuous Assessment in Boarding Schools.pdf
The Asian School
 
PPTX
MET 305 MODULE 1 KTU 2019 SCHEME 25.pptx
VinayB68
 
PDF
LEAP-1B presedntation xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hatem173148
 
PPTX
Module2 Data Base Design- ER and NF.pptx
gomathisankariv2
 
PDF
algorithms-16-00088-v2hghjjnjnhhhnnjhj.pdf
Ajaykumar966781
 
PDF
Unit I Part II.pdf : Security Fundamentals
Dr. Madhuri Jawale
 
PDF
Chad Ayach - A Versatile Aerospace Professional
Chad Ayach
 
PDF
Structs to JSON How Go Powers REST APIs.pdf
Emily Achieng
 
PPT
SCOPE_~1- technology of green house and poyhouse
bala464780
 
PPTX
EE3303-EM-I 25.7.25 electrical machines.pptx
Nagen87
 
Software Testing Tools - names and explanation
shruti533256
 
2010_Book_EnvironmentalBioengineering (1).pdf
EmilianoRodriguezTll
 
Fluid Mechanics, Module 3: Basics of Fluid Mechanics
Dr. Rahul Kumar
 
ANIMAL INTERVENTION WARNING SYSTEM (4).pptx
dodultrongaming
 
Simulation of electric circuit laws using tinkercad.pptx
VidhyaH3
 
Edge to Cloud Protocol HTTP WEBSOCKET MQTT-SN MQTT.pptx
dhanashri894551
 
6th International Conference on Artificial Intelligence and Machine Learning ...
gerogepatton
 
July 2025: Top 10 Read Articles Advanced Information Technology
ijait
 
dse_final_merit_2025_26 gtgfffffcjjjuuyy
rushabhjain127
 
Traditional Exams vs Continuous Assessment in Boarding Schools.pdf
The Asian School
 
MET 305 MODULE 1 KTU 2019 SCHEME 25.pptx
VinayB68
 
LEAP-1B presedntation xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hatem173148
 
Module2 Data Base Design- ER and NF.pptx
gomathisankariv2
 
algorithms-16-00088-v2hghjjnjnhhhnnjhj.pdf
Ajaykumar966781
 
Unit I Part II.pdf : Security Fundamentals
Dr. Madhuri Jawale
 
Chad Ayach - A Versatile Aerospace Professional
Chad Ayach
 
Structs to JSON How Go Powers REST APIs.pdf
Emily Achieng
 
SCOPE_~1- technology of green house and poyhouse
bala464780
 
EE3303-EM-I 25.7.25 electrical machines.pptx
Nagen87
 

C variables and constants

  • 1. Notes on Variable & Constant Instructor: Arghodeep Paul Firmware Engineer at BitBible Technologies Pvt. Ltd. Content Author: Arghodeep Paul License: OpenSource Date: 14 July 2021
  • 2. Variable A Variable is nothing but a name given to a Memory location. That Memory Location belongs to Primary Storage(RAM) or in CPU registers. Variables are created of a specific Data Type. Syntax int number; // declaration of a int type variable number=3; // initialization of the value Or int number=3; // declaration and initialization together Constant Same as the variable but the only difference is you can not change the Value after it has been initialized. Syntax #define PI 3.14 //no equal sign no semicolon Or const float PI=3.14; Note: Constant identifiers are written in CAPITAL as a convention.