SlideShare a Scribd company logo
1 of 13
Constants in ‘C’
By:SatveerKaur,AssistantProfessor,KhalsaCollege,Patiala.
1
Constant
Refer to fixed values.
Values do not change during the execution of a
program.
Uses the secondary storage area.
For every language, constants are same.
By: Satveer Kaur, Assistant Professor, Khalsa College, Patiala.
2
Types of Constant
Constant
Numeric
constant
Integer
constant
Real constant
Character
constant
Single character
constant
String constant
By: Satveer Kaur, Assistant Professor, Khalsa College, Patiala.
3
Numeric constant
By: Satveer Kaur, Assistant Professor, Khalsa College, Patiala.
4
Have numeric value having a combination of sequence of digits.
0-9 as alone digits or combination of 0-9 with or without decimal point.
Integer numeric constant
Decimal integer
Octal integer
Hexadecimal integer
By: Satveer Kaur, Assistant Professor, Khalsa College, Patiala.
5
Integer numeric constant
Decimal integer
•A set of digits 0-9, preceded by an optional – or + sign.
•Embedded spaces, commas, non-digit characters are not permitted between digits.
•Examples are 123, -321, 0 , 654321, +78
Octal integer
•Consist of any combination of digits 0-7, with a leading 0.
•Examples are 037, 0, 0435, 0551
Hexadecimal
Integer
•Sequence of digits preceded by 0x or 0X.
•Also include alphabets A through F or a through f representing numbers 10-15.
•Examples are 0x2, 0X9F, oxbcd, 0X.
By: Satveer Kaur, Assistant Professor, Khalsa College, Patiala.
6
Range of integer constants
Generally it is machine dependent for largest integer value.
On 16-bit machines, it is 32767.
On 32-bit machines, it is 2,147,483,647.
Also possible to store larger integer constants by appending qualifiers like U, L and UL.
By: Satveer Kaur, Assistant Professor, Khalsa College, Patiala.
7
Examples:
Unsigned integer
Unsigned long integer
Long integer
• 56789U
• 56789u
• 985674213UL
• 985674213ul
• 9876543L
• 9876543l
By: Satveer Kaur, Assistant Professor, Khalsa College, Patiala.
8
Real Constant
Real
constants
Are represented by numbers containing fractional parts like 15.456
Are shown in decimal notation, having a whole number followed by a decimal point and the fractional point.
Possible to omit digits before or after the decimal points e.g. 215. , .95 , -.72 , +.5
May also be expressed in exponential(or scientific) notation. General form is mantissa e exponent
Example is 215.65 may be written as 2.1565e2
e2 means multiply by 102
By: Satveer Kaur, Assistant Professor, Khalsa College, Patiala.
9
Real Constants
Real
constants
Mantissa is either a real number represented in decimal notation or an integer.
Exponent is an integer number with an optional plus or minus sign.
Letter e separating the mantissa and the exponent can be written inn uppercase or lowercase.
Embedded white space is not allowed.
Are useful for very large or very small numbers e.g. 9500000000 may be written as 9.5E9 or 95E8 and -0.000000348 be
as -3.48E-7
By: Satveer Kaur, Assistant Professor, Khalsa College, Patiala.
10
Single character constant
Contains a single character enclosed in single quote marks e.g. ‘5’
, ‘X’.
Character constant is not the same as the numbers.
Have integer values known as ASCII values e.g. ‘a’ have 97 as its
ASCII value..
Also possible to perform arithmetic operations on character
constants.
By: Satveer Kaur, Assistant Professor, Khalsa College, Patiala.
11
String constants
A sequence of characters enclosed in double quotes.
Characters may be letters, numbers, special characters,
and blank spaces e.g. “Hello”, “1987”
Single character string is not equivalent to a character
constant and does not have an equivalent integer value.
By: Satveer Kaur, Assistant Professor, Khalsa College, Patiala.
12
THANK YOU
By: Satveer Kaur, Assistant Professor, Khalsa College, Patiala.
13

More Related Content

What's hot

Translating Mathematical Phrases into Algebraic Expressions or Equations
Translating Mathematical Phrases into Algebraic Expressions or EquationsTranslating Mathematical Phrases into Algebraic Expressions or Equations
Translating Mathematical Phrases into Algebraic Expressions or EquationsSonarin Cruz
 
1.1 and 1.2
1.1 and 1.21.1 and 1.2
1.1 and 1.2leblance
 
Operators and expressons
Operators and expressonsOperators and expressons
Operators and expressonsSatveer Mann
 
Differential Equation SlideShare by Kamran Zafar
Differential Equation SlideShare by Kamran ZafarDifferential Equation SlideShare by Kamran Zafar
Differential Equation SlideShare by Kamran ZafarKamran Zafar
 
Module For Mathematics
Module For Mathematics Module For Mathematics
Module For Mathematics jrbt2014
 
Participation Constraints in ER diagram
Participation Constraints in ER diagramParticipation Constraints in ER diagram
Participation Constraints in ER diagramMegha Sharma
 
9.2 rational and irrational numbers day 1
9.2 rational and irrational numbers day 19.2 rational and irrational numbers day 1
9.2 rational and irrational numbers day 1bweldon
 
3.1 tuple relational_calculus
3.1 tuple relational_calculus3.1 tuple relational_calculus
3.1 tuple relational_calculusUtkarsh De
 
Addition of integers Grade 6
Addition of integers Grade 6Addition of integers Grade 6
Addition of integers Grade 6jona0616
 
3 relational model
3 relational model3 relational model
3 relational modelUtkarsh De
 
2 entity relationship_model
2 entity relationship_model2 entity relationship_model
2 entity relationship_modelUtkarsh De
 
Scaffold reading presentation.Slideshow
Scaffold reading presentation.SlideshowScaffold reading presentation.Slideshow
Scaffold reading presentation.SlideshowTouché Tanner
 
Scaffold reading presentation
Scaffold reading presentationScaffold reading presentation
Scaffold reading presentationTouché Tanner
 
Adding gift questions in swayam 2.0
Adding gift questions  in swayam 2.0Adding gift questions  in swayam 2.0
Adding gift questions in swayam 2.0aschrdc
 
Rational numbers
Rational numbersRational numbers
Rational numbersPooja M
 

What's hot (17)

Translating Mathematical Phrases into Algebraic Expressions or Equations
Translating Mathematical Phrases into Algebraic Expressions or EquationsTranslating Mathematical Phrases into Algebraic Expressions or Equations
Translating Mathematical Phrases into Algebraic Expressions or Equations
 
1.1 and 1.2
1.1 and 1.21.1 and 1.2
1.1 and 1.2
 
Operators and expressons
Operators and expressonsOperators and expressons
Operators and expressons
 
7 2
7 27 2
7 2
 
Differential Equation SlideShare by Kamran Zafar
Differential Equation SlideShare by Kamran ZafarDifferential Equation SlideShare by Kamran Zafar
Differential Equation SlideShare by Kamran Zafar
 
Module For Mathematics
Module For Mathematics Module For Mathematics
Module For Mathematics
 
Participation Constraints in ER diagram
Participation Constraints in ER diagramParticipation Constraints in ER diagram
Participation Constraints in ER diagram
 
9.2 rational and irrational numbers day 1
9.2 rational and irrational numbers day 19.2 rational and irrational numbers day 1
9.2 rational and irrational numbers day 1
 
3.1 tuple relational_calculus
3.1 tuple relational_calculus3.1 tuple relational_calculus
3.1 tuple relational_calculus
 
Operators in c
Operators in cOperators in c
Operators in c
 
Addition of integers Grade 6
Addition of integers Grade 6Addition of integers Grade 6
Addition of integers Grade 6
 
3 relational model
3 relational model3 relational model
3 relational model
 
2 entity relationship_model
2 entity relationship_model2 entity relationship_model
2 entity relationship_model
 
Scaffold reading presentation.Slideshow
Scaffold reading presentation.SlideshowScaffold reading presentation.Slideshow
Scaffold reading presentation.Slideshow
 
Scaffold reading presentation
Scaffold reading presentationScaffold reading presentation
Scaffold reading presentation
 
Adding gift questions in swayam 2.0
Adding gift questions  in swayam 2.0Adding gift questions  in swayam 2.0
Adding gift questions in swayam 2.0
 
Rational numbers
Rational numbersRational numbers
Rational numbers
 

Similar to Constants in C

Data Types and Variables In C Programming
Data Types and Variables In C ProgrammingData Types and Variables In C Programming
Data Types and Variables In C ProgrammingKamal Acharya
 
COM1407: Variables and Data Types
COM1407: Variables and Data Types COM1407: Variables and Data Types
COM1407: Variables and Data Types Hemantha Kulathilake
 
Constants and variables in c programming
Constants and variables in c programmingConstants and variables in c programming
Constants and variables in c programmingChitrank Dixit
 
PROGRAMMING IN C - Inroduction.pptx
PROGRAMMING IN C - Inroduction.pptxPROGRAMMING IN C - Inroduction.pptx
PROGRAMMING IN C - Inroduction.pptxNithya K
 
Constants in C Programming
Constants in C ProgrammingConstants in C Programming
Constants in C Programmingprogramming9
 
L2 C# Programming Comments, Keywords, Identifiers, Variables.pdf
L2 C# Programming Comments, Keywords, Identifiers, Variables.pdfL2 C# Programming Comments, Keywords, Identifiers, Variables.pdf
L2 C# Programming Comments, Keywords, Identifiers, Variables.pdfMMRF2
 
Constants Variables Datatypes by Mrs. Sowmya Jyothi
Constants Variables Datatypes by Mrs. Sowmya JyothiConstants Variables Datatypes by Mrs. Sowmya Jyothi
Constants Variables Datatypes by Mrs. Sowmya JyothiSowmyaJyothi3
 

Similar to Constants in C (11)

Data Types and Variables In C Programming
Data Types and Variables In C ProgrammingData Types and Variables In C Programming
Data Types and Variables In C Programming
 
COM1407: Variables and Data Types
COM1407: Variables and Data Types COM1407: Variables and Data Types
COM1407: Variables and Data Types
 
Constants and variables in c programming
Constants and variables in c programmingConstants and variables in c programming
Constants and variables in c programming
 
PROGRAMMING IN C - Inroduction.pptx
PROGRAMMING IN C - Inroduction.pptxPROGRAMMING IN C - Inroduction.pptx
PROGRAMMING IN C - Inroduction.pptx
 
Introduction
IntroductionIntroduction
Introduction
 
Constants in C Programming
Constants in C ProgrammingConstants in C Programming
Constants in C Programming
 
Ch08
Ch08Ch08
Ch08
 
Variables in C
Variables in CVariables in C
Variables in C
 
Central tedency
Central tedencyCentral tedency
Central tedency
 
L2 C# Programming Comments, Keywords, Identifiers, Variables.pdf
L2 C# Programming Comments, Keywords, Identifiers, Variables.pdfL2 C# Programming Comments, Keywords, Identifiers, Variables.pdf
L2 C# Programming Comments, Keywords, Identifiers, Variables.pdf
 
Constants Variables Datatypes by Mrs. Sowmya Jyothi
Constants Variables Datatypes by Mrs. Sowmya JyothiConstants Variables Datatypes by Mrs. Sowmya Jyothi
Constants Variables Datatypes by Mrs. Sowmya Jyothi
 

More from Satveer Mann

keywords and identifiers
 keywords and identifiers keywords and identifiers
keywords and identifiersSatveer Mann
 
Preprocessor directives
Preprocessor directivesPreprocessor directives
Preprocessor directivesSatveer Mann
 
Program structure of c
Program structure of cProgram structure of c
Program structure of cSatveer Mann
 
Algorithms, flow charts and pseudocodes
Algorithms, flow charts and pseudocodesAlgorithms, flow charts and pseudocodes
Algorithms, flow charts and pseudocodesSatveer Mann
 
Problem solving process
Problem solving processProblem solving process
Problem solving processSatveer Mann
 
Character set in C
Character set in CCharacter set in C
Character set in CSatveer Mann
 
Introduction to c
 Introduction to c Introduction to c
Introduction to cSatveer Mann
 

More from Satveer Mann (8)

Data types in C
Data types in CData types in C
Data types in C
 
keywords and identifiers
 keywords and identifiers keywords and identifiers
keywords and identifiers
 
Preprocessor directives
Preprocessor directivesPreprocessor directives
Preprocessor directives
 
Program structure of c
Program structure of cProgram structure of c
Program structure of c
 
Algorithms, flow charts and pseudocodes
Algorithms, flow charts and pseudocodesAlgorithms, flow charts and pseudocodes
Algorithms, flow charts and pseudocodes
 
Problem solving process
Problem solving processProblem solving process
Problem solving process
 
Character set in C
Character set in CCharacter set in C
Character set in C
 
Introduction to c
 Introduction to c Introduction to c
Introduction to c
 

Recently uploaded

Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
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
 
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
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
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
 
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
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 

Recently uploaded (20)

Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
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
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
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
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
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...
 
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
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 

Constants in C

  • 2. Constant Refer to fixed values. Values do not change during the execution of a program. Uses the secondary storage area. For every language, constants are same. By: Satveer Kaur, Assistant Professor, Khalsa College, Patiala. 2
  • 3. Types of Constant Constant Numeric constant Integer constant Real constant Character constant Single character constant String constant By: Satveer Kaur, Assistant Professor, Khalsa College, Patiala. 3
  • 4. Numeric constant By: Satveer Kaur, Assistant Professor, Khalsa College, Patiala. 4 Have numeric value having a combination of sequence of digits. 0-9 as alone digits or combination of 0-9 with or without decimal point.
  • 5. Integer numeric constant Decimal integer Octal integer Hexadecimal integer By: Satveer Kaur, Assistant Professor, Khalsa College, Patiala. 5
  • 6. Integer numeric constant Decimal integer •A set of digits 0-9, preceded by an optional – or + sign. •Embedded spaces, commas, non-digit characters are not permitted between digits. •Examples are 123, -321, 0 , 654321, +78 Octal integer •Consist of any combination of digits 0-7, with a leading 0. •Examples are 037, 0, 0435, 0551 Hexadecimal Integer •Sequence of digits preceded by 0x or 0X. •Also include alphabets A through F or a through f representing numbers 10-15. •Examples are 0x2, 0X9F, oxbcd, 0X. By: Satveer Kaur, Assistant Professor, Khalsa College, Patiala. 6
  • 7. Range of integer constants Generally it is machine dependent for largest integer value. On 16-bit machines, it is 32767. On 32-bit machines, it is 2,147,483,647. Also possible to store larger integer constants by appending qualifiers like U, L and UL. By: Satveer Kaur, Assistant Professor, Khalsa College, Patiala. 7
  • 8. Examples: Unsigned integer Unsigned long integer Long integer • 56789U • 56789u • 985674213UL • 985674213ul • 9876543L • 9876543l By: Satveer Kaur, Assistant Professor, Khalsa College, Patiala. 8
  • 9. Real Constant Real constants Are represented by numbers containing fractional parts like 15.456 Are shown in decimal notation, having a whole number followed by a decimal point and the fractional point. Possible to omit digits before or after the decimal points e.g. 215. , .95 , -.72 , +.5 May also be expressed in exponential(or scientific) notation. General form is mantissa e exponent Example is 215.65 may be written as 2.1565e2 e2 means multiply by 102 By: Satveer Kaur, Assistant Professor, Khalsa College, Patiala. 9
  • 10. Real Constants Real constants Mantissa is either a real number represented in decimal notation or an integer. Exponent is an integer number with an optional plus or minus sign. Letter e separating the mantissa and the exponent can be written inn uppercase or lowercase. Embedded white space is not allowed. Are useful for very large or very small numbers e.g. 9500000000 may be written as 9.5E9 or 95E8 and -0.000000348 be as -3.48E-7 By: Satveer Kaur, Assistant Professor, Khalsa College, Patiala. 10
  • 11. Single character constant Contains a single character enclosed in single quote marks e.g. ‘5’ , ‘X’. Character constant is not the same as the numbers. Have integer values known as ASCII values e.g. ‘a’ have 97 as its ASCII value.. Also possible to perform arithmetic operations on character constants. By: Satveer Kaur, Assistant Professor, Khalsa College, Patiala. 11
  • 12. String constants A sequence of characters enclosed in double quotes. Characters may be letters, numbers, special characters, and blank spaces e.g. “Hello”, “1987” Single character string is not equivalent to a character constant and does not have an equivalent integer value. By: Satveer Kaur, Assistant Professor, Khalsa College, Patiala. 12
  • 13. THANK YOU By: Satveer Kaur, Assistant Professor, Khalsa College, Patiala. 13