SlideShare a Scribd company logo
Variables in ‘C’ Language
By: Satveer Kaur, Assistant Professor, Khalsa College, Patiala. 1
Variable
A data name that may be used to store a data value.
Uses the primary storage area.
Value vary during the execution time.
May take different values at different times.
Basically memory locations which are given names and
referred in the program by variable names.
Are used for identification for entering the information and
data.
Must be in a meaningful way to reflect its function and
nature in the program.
By: Satveer Kaur, Assistant Professor, Khalsa College, Patiala. 2
Variable may
consist of
Letters
Digits
Underscore(_)
By: Satveer Kaur, Assistant Professor, Khalsa College, Patiala. 3
Examples of
Variable
Average
height
Total
Counter_1
Class_strength
distance
By: Satveer Kaur, Assistant Professor, Khalsa College, Patiala. 4
Rules for
defining a
variable
Must begin with a letter
Some systems permit underscore as a first character.
Length can be maximum up to 31 characters.
Uppercase and lowercase letters are significant.
White space is not allowed.
By: Satveer Kaur, Assistant Professor, Khalsa College, Patiala. 5
Examples of
valid and
invalid variable
names:
• John
• mark
• x1
• T_raise
• ph_value
Valid
• 123
• %
• (area)
• 25th
Invalid
By: Satveer Kaur, Assistant Professor, Khalsa College, Patiala. 6
ThankYou
By: Satveer Kaur, Assistant Professor, Khalsa College, Patiala. 7

More Related Content

PPT
An Intuitive Natural Language Understanding System
PDF
Example for ER diagram part11
DOCX
ABHIRESUME
PPT
Improvement in Quality of Speech associated with Braille codes - A Review
PDF
I1 geetha3 revathi
PDF
Clustering Algorithm for Gujarati Language
PDF
Copy Of Univ
PDF
Named Entity Recognition using Hidden Markov Model (HMM)
An Intuitive Natural Language Understanding System
Example for ER diagram part11
ABHIRESUME
Improvement in Quality of Speech associated with Braille codes - A Review
I1 geetha3 revathi
Clustering Algorithm for Gujarati Language
Copy Of Univ
Named Entity Recognition using Hidden Markov Model (HMM)

Similar to Variables in C (20)

PPTX
C language variables
PDF
Variables
 
PPTX
What is a Variable in C Language? | Variable Declaration and initialization.pptx
PPTX
Std 10 computer chapter 10 introduction to c language (part2)
PPTX
Versatile Variables
PPTX
Python Variable for the students who started their python.pptx
PDF
Python - Lecture 1
PPTX
Presentation on 21.11.2022.pptx
PPTX
C Language presentation
PDF
Lec-1c.pdf
PPTX
Computer Programming Java VARIABLES.pptx
DOCX
Programming Fundamentals lecture 4
PPTX
Constants and variables in c programming
PPTX
Chapter 1 - Variables, Data types + Input/Output
DOC
PPTX
C PROGRAMING.pptx
PPTX
Constant and variacles in c
PDF
Lecture 4 constants_variables
PPTX
Variable is a symbolic name for information
PPTX
G9 Polaris Programming.pptx algorithm information communication technology
C language variables
Variables
 
What is a Variable in C Language? | Variable Declaration and initialization.pptx
Std 10 computer chapter 10 introduction to c language (part2)
Versatile Variables
Python Variable for the students who started their python.pptx
Python - Lecture 1
Presentation on 21.11.2022.pptx
C Language presentation
Lec-1c.pdf
Computer Programming Java VARIABLES.pptx
Programming Fundamentals lecture 4
Constants and variables in c programming
Chapter 1 - Variables, Data types + Input/Output
C PROGRAMING.pptx
Constant and variacles in c
Lecture 4 constants_variables
Variable is a symbolic name for information
G9 Polaris Programming.pptx algorithm information communication technology
Ad

More from Satveer Mann (10)

PPTX
Operators and expressons
PPTX
Data types in C
PPTX
Constants in C
PPTX
keywords and identifiers
PPTX
Preprocessor directives
PPTX
Program structure of c
PPTX
Algorithms, flow charts and pseudocodes
PPTX
Problem solving process
PPTX
Character set in C
PPTX
Introduction to c
Operators and expressons
Data types in C
Constants in C
keywords and identifiers
Preprocessor directives
Program structure of c
Algorithms, flow charts and pseudocodes
Problem solving process
Character set in C
Introduction to c
Ad

Recently uploaded (20)

PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
RMMM.pdf make it easy to upload and study
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
TR - Agricultural Crops Production NC III.pdf
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
Lesson notes of climatology university.
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
Institutional Correction lecture only . . .
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
Classroom Observation Tools for Teachers
PDF
Sports Quiz easy sports quiz sports quiz
PDF
01-Introduction-to-Information-Management.pdf
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Insiders guide to clinical Medicine.pdf
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
Pharma ospi slides which help in ospi learning
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
PPH.pptx obstetrics and gynecology in nursing
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
RMMM.pdf make it easy to upload and study
Module 4: Burden of Disease Tutorial Slides S2 2025
TR - Agricultural Crops Production NC III.pdf
human mycosis Human fungal infections are called human mycosis..pptx
Lesson notes of climatology university.
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Institutional Correction lecture only . . .
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Classroom Observation Tools for Teachers
Sports Quiz easy sports quiz sports quiz
01-Introduction-to-Information-Management.pdf
O5-L3 Freight Transport Ops (International) V1.pdf
Insiders guide to clinical Medicine.pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Pharma ospi slides which help in ospi learning
Microbial diseases, their pathogenesis and prophylaxis
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPH.pptx obstetrics and gynecology in nursing

Variables in C

  • 1. Variables in ‘C’ Language By: Satveer Kaur, Assistant Professor, Khalsa College, Patiala. 1
  • 2. Variable A data name that may be used to store a data value. Uses the primary storage area. Value vary during the execution time. May take different values at different times. Basically memory locations which are given names and referred in the program by variable names. Are used for identification for entering the information and data. Must be in a meaningful way to reflect its function and nature in the program. By: Satveer Kaur, Assistant Professor, Khalsa College, Patiala. 2
  • 3. Variable may consist of Letters Digits Underscore(_) By: Satveer Kaur, Assistant Professor, Khalsa College, Patiala. 3
  • 5. Rules for defining a variable Must begin with a letter Some systems permit underscore as a first character. Length can be maximum up to 31 characters. Uppercase and lowercase letters are significant. White space is not allowed. By: Satveer Kaur, Assistant Professor, Khalsa College, Patiala. 5
  • 6. Examples of valid and invalid variable names: • John • mark • x1 • T_raise • ph_value Valid • 123 • % • (area) • 25th Invalid By: Satveer Kaur, Assistant Professor, Khalsa College, Patiala. 6
  • 7. ThankYou By: Satveer Kaur, Assistant Professor, Khalsa College, Patiala. 7