SlideShare a Scribd company logo
4
Most read
5
Most read
6
Most read
C language Character Set, Keywords, Constants, Variables, Data types
Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
Sourav Ganguly
Please visit my Youtube channel
Step 1: go to www.google.com
Step 2: Search for “sourav ganguly c programming”.
Step 3: Click on my image bottom of the video. You will reach my
channel.
Youtube (direct link):
https://www.youtube.com/channel/UCDsQskBhM107VIYLjg8kczg
Website:
http://www.startselfstudy.blogspot.in
Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
Character Set of C language…..
Keywords of C language…..
Constants of C language…..
Rules for Constructing Constants…..
Variables of C language…..
Rules for Constructing Variables…..
Data types of C language…..
Data types Range, Length and format…..
Index
Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
Character Set of C language…..
Character Set
Alphabets
A, B, C, D, ….. , W, X, Y, Z
a, b, c, d, ….., w, x, y, z
Digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Special symbols ~ ‘ ! @ # % ^ & * ( ) _ - + = |  { } [ ] : ; " ' < > , . ? /
We may use those characters at the time of writing any C
programme. C compiler will support those characters.
Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
Keywords of C language…..
You may use those keywords at the time of writing any C
programme.
Each keyword has it’s own meaning. You can’t use them
for other purpose.
Keywords or Reserved words
void double default union
int goto for extern
float if do enum
char else while sizeof
short switch struct return
long case const auto
signed break static volatile
unsigned continue typedef register
Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
Constants of C language…..
Example of constants
Integer Constants +211, -80, 45 (assumed as +45)
Real Constants (normal) +211.12, -80.12, 45.12 (assumed as +45.12)
Real Constants (exponential) +1.5e-4, -0.5e+4, -1.5e-4, 1.4e5 (assumed as +1.4e5)
Character Constants ‘D‘ , ‘d‘ , '5‘ , '='
Integer Constants Real Constants (normal)
Real Constants
(exponential)
Character Constants
(a) Must contain at least
one digit.
(b) No decimal point.
(c) May be positive or
negative.
(d) No sign means positive.
(e) Commas and blanks
must not present in an
integer constant.
(a) Must contain at least one
digit.
(b) Contain decimal point.
(c) May be positive or
negative.
(d) No sign means positive.
(e) Commas and blanks must
not present in an integer
constant. .
(a) Mantissa and
exponential separated by a
letter e.
(b) The mantissa may be
positive or negative.
(c) No sign means positive.
(d) The exponent Must
contain at least one digit.
May be positive or negative.
No sign means positive.
(a) Must contain at least one
single alphabet, digit or
special symbol. Within
single inverted commas.
(b)Maximum length is one
character.
Rules for Constructing Constants…..
Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
Variables of C language…..
Example of Variables
Integer Variables int a=3;
Real Variables float a=3.33;
Character Variables char a=‘3’;
Integer Variables Float Variables Character Variables
(a) variable name must start
with alphabet or underscore.
(b) Do not use commas or
blanks in a variable name.
(c) Do not use any special
symbol in a variable name
except underscore
(d) It is better to use short
variable name for C compiler.
(less than 31 character).
(a) variable name must start
with alphabet or underscore.
(b) Do not use commas or
blanks in a variable name.
(c) Do not use any special
symbol in a variable name
except underscore
(d) It is better to use short
variable name for C compiler.
(less than 31 character).
(a) variable name must start
with alphabet or underscore.
(b) Do not use commas or
blanks in a variable name.
(c) Do not use any special
symbol in a variable name
except underscore
(d) It is better to use short
variable name for C compiler.
(less than 31 character).
Rules for Constructing Variables …..
Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
Data Types Data types Range length (bytes) format
signed char -128 to + 127 1 %c
unsigned char 0 to 255 1 %c
short signed int -32768 to +32767 2 %d
short unsigned int 0 to 65535 2 %u
signed int -32768 to +32767 2 %d
unsigned int 0 to 65535 2 %u
long signed int -2147483648 to +2147483647 4 %ld
long unsigned int 0 to 4294967295 4 %lu
float -3.4e38 to +3.4e38 4 %f
double -1.7e308 to +1.7e308 8 %lf
long double -1.7e4932 to +1.7e4932 10 %Lf
Example of Data type with Variables at the time of input and
output
Data Types printf() scanf()
int a,b; printf(“%d %d”,a,b); scanf(“%d %d”,&a,&b);
float a,b; printf(“%f %f”,a,b); scanf(“%f %f”,&a,&b);
char a,b; printf(“%c %c”,a,b); scanf(“%c %c”,&a,&b);
Data types of C language…..
Data types Range, Length and format…..
Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
Sourav Ganguly
Please visit my Youtube channel
Step 1: go to www.google.com
Step 2: Search for “sourav ganguly c programming”.
Step 3: Click on my image bottom of the video. You will reach my
channel.
Youtube (direct link):
https://www.youtube.com/channel/UCDsQskBhM107VIYLjg8kczg
Website:
http://www.startselfstudy.blogspot.in
Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
Sourav Ganguly
Please visit my Youtube channel
Step 1: go to www.google.com
Step 2: Search for “sourav ganguly c programming”.
Step 3: Click on my image bottom of the video. You will reach my
channel.
Youtube (direct link):
https://www.youtube.com/channel/UCDsQskBhM107VIYLjg8kczg
Website:
http://www.startselfstudy.blogspot.in
Copyright © 2015 · Sourav Ganguly · All Rights Reserved.

More Related Content

PPT
Dynamic programming
PPTX
Polymorphism presentation in java
PPT
Synchronization.37
PDF
Algorithms Lecture 2: Analysis of Algorithms I
PDF
Exception handling
DOCX
Java questions for viva
PPTX
Critical section problem in operating system.
DOC
Arrays and Strings
Dynamic programming
Polymorphism presentation in java
Synchronization.37
Algorithms Lecture 2: Analysis of Algorithms I
Exception handling
Java questions for viva
Critical section problem in operating system.
Arrays and Strings

What's hot (20)

PPTX
Directed Acyclic Graph Representation of basic blocks
PPTX
Travelling salesman dynamic programming
PPTX
Arrays in java
PPTX
Greedy algorithms
PDF
Reinforcement learning
PPT
Method overriding
PPTX
Input buffering
PPTX
Tsp is NP-Complete
PPTX
Java utility classes
PPTX
Slice Based testing and Object Oriented Testing
PPTX
Characteristics of OOPS
PPT
Lower bound
PDF
Polymorphism In Java
PPTX
Test suite minimization
PPTX
Iv defuzzification methods
PPT
Final keyword in java
PPTX
Constants in java
PDF
String matching, naive,
PPTX
INHERITANCE IN JAVA.pptx
PPTX
Longest Common Subsequence
Directed Acyclic Graph Representation of basic blocks
Travelling salesman dynamic programming
Arrays in java
Greedy algorithms
Reinforcement learning
Method overriding
Input buffering
Tsp is NP-Complete
Java utility classes
Slice Based testing and Object Oriented Testing
Characteristics of OOPS
Lower bound
Polymorphism In Java
Test suite minimization
Iv defuzzification methods
Final keyword in java
Constants in java
String matching, naive,
INHERITANCE IN JAVA.pptx
Longest Common Subsequence
Ad

Similar to C programming language character set keywords constants variables data types (20)

PDF
PSPC--UNIT-2.pdf
PPTX
Constants variables data_types
PPTX
Data Types and Variables In C Programming
PDF
Constants Variables Datatypes by Mrs. Sowmya Jyothi
DOCX
C programming tutorial
PPTX
Introduction to C language programming.pptx
PDF
[ITP - Lecture 04] Variables and Constants in C/C++
PPTX
C Programming Lecture 3 - Elements of C.pptx
PPTX
Module 1:Introduction
DOCX
C basics by haseeb khan
PDF
C Tutorial
PPT
CONSTANTS, VARIABLES & DATATYPES IN C
PPT
constants, variables and datatypes in C
PPTX
COM1407: Variables and Data Types
PDF
Introduction
PPT
Session02 c intro
PPSX
Programming in c
PPTX
PPT
Escape Sequences and Variables
PPT
C presentation book
PSPC--UNIT-2.pdf
Constants variables data_types
Data Types and Variables In C Programming
Constants Variables Datatypes by Mrs. Sowmya Jyothi
C programming tutorial
Introduction to C language programming.pptx
[ITP - Lecture 04] Variables and Constants in C/C++
C Programming Lecture 3 - Elements of C.pptx
Module 1:Introduction
C basics by haseeb khan
C Tutorial
CONSTANTS, VARIABLES & DATATYPES IN C
constants, variables and datatypes in C
COM1407: Variables and Data Types
Introduction
Session02 c intro
Programming in c
Escape Sequences and Variables
C presentation book
Ad

More from Sourav Ganguly (6)

PPTX
C program language tutorial pattern printing
PPTX
C program language tutorial for loop while loop do while loop
PPT
How to write c program with code blocks
PPT
How to write c programme
PPTX
Basic knowledge to learn c language
PPTX
Basic knowledge to learn c language
C program language tutorial pattern printing
C program language tutorial for loop while loop do while loop
How to write c program with code blocks
How to write c programme
Basic knowledge to learn c language
Basic knowledge to learn c language

Recently uploaded (20)

PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
Weekly quiz Compilation Jan -July 25.pdf
PDF
Supply Chain Operations Speaking Notes -ICLT Program
DOC
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PDF
Trump Administration's workforce development strategy
PPTX
GDM (1) (1).pptx small presentation for students
PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
PDF
Complications of Minimal Access Surgery at WLH
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
A systematic review of self-coping strategies used by university students to ...
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Final Presentation General Medicine 03-08-2024.pptx
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Weekly quiz Compilation Jan -July 25.pdf
Supply Chain Operations Speaking Notes -ICLT Program
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
human mycosis Human fungal infections are called human mycosis..pptx
O5-L3 Freight Transport Ops (International) V1.pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
Trump Administration's workforce development strategy
GDM (1) (1).pptx small presentation for students
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
Complications of Minimal Access Surgery at WLH
O7-L3 Supply Chain Operations - ICLT Program
Microbial diseases, their pathogenesis and prophylaxis
Microbial disease of the cardiovascular and lymphatic systems
A systematic review of self-coping strategies used by university students to ...
Module 4: Burden of Disease Tutorial Slides S2 2025
Abdominal Access Techniques with Prof. Dr. R K Mishra
Chapter 2 Heredity, Prenatal Development, and Birth.pdf

C programming language character set keywords constants variables data types

  • 1. C language Character Set, Keywords, Constants, Variables, Data types Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
  • 2. Sourav Ganguly Please visit my Youtube channel Step 1: go to www.google.com Step 2: Search for “sourav ganguly c programming”. Step 3: Click on my image bottom of the video. You will reach my channel. Youtube (direct link): https://www.youtube.com/channel/UCDsQskBhM107VIYLjg8kczg Website: http://www.startselfstudy.blogspot.in Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
  • 3. Character Set of C language….. Keywords of C language….. Constants of C language….. Rules for Constructing Constants….. Variables of C language….. Rules for Constructing Variables….. Data types of C language….. Data types Range, Length and format….. Index Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
  • 4. Character Set of C language….. Character Set Alphabets A, B, C, D, ….. , W, X, Y, Z a, b, c, d, ….., w, x, y, z Digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Special symbols ~ ‘ ! @ # % ^ & * ( ) _ - + = | { } [ ] : ; " ' < > , . ? / We may use those characters at the time of writing any C programme. C compiler will support those characters. Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
  • 5. Keywords of C language….. You may use those keywords at the time of writing any C programme. Each keyword has it’s own meaning. You can’t use them for other purpose. Keywords or Reserved words void double default union int goto for extern float if do enum char else while sizeof short switch struct return long case const auto signed break static volatile unsigned continue typedef register Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
  • 6. Constants of C language….. Example of constants Integer Constants +211, -80, 45 (assumed as +45) Real Constants (normal) +211.12, -80.12, 45.12 (assumed as +45.12) Real Constants (exponential) +1.5e-4, -0.5e+4, -1.5e-4, 1.4e5 (assumed as +1.4e5) Character Constants ‘D‘ , ‘d‘ , '5‘ , '=' Integer Constants Real Constants (normal) Real Constants (exponential) Character Constants (a) Must contain at least one digit. (b) No decimal point. (c) May be positive or negative. (d) No sign means positive. (e) Commas and blanks must not present in an integer constant. (a) Must contain at least one digit. (b) Contain decimal point. (c) May be positive or negative. (d) No sign means positive. (e) Commas and blanks must not present in an integer constant. . (a) Mantissa and exponential separated by a letter e. (b) The mantissa may be positive or negative. (c) No sign means positive. (d) The exponent Must contain at least one digit. May be positive or negative. No sign means positive. (a) Must contain at least one single alphabet, digit or special symbol. Within single inverted commas. (b)Maximum length is one character. Rules for Constructing Constants….. Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
  • 7. Variables of C language….. Example of Variables Integer Variables int a=3; Real Variables float a=3.33; Character Variables char a=‘3’; Integer Variables Float Variables Character Variables (a) variable name must start with alphabet or underscore. (b) Do not use commas or blanks in a variable name. (c) Do not use any special symbol in a variable name except underscore (d) It is better to use short variable name for C compiler. (less than 31 character). (a) variable name must start with alphabet or underscore. (b) Do not use commas or blanks in a variable name. (c) Do not use any special symbol in a variable name except underscore (d) It is better to use short variable name for C compiler. (less than 31 character). (a) variable name must start with alphabet or underscore. (b) Do not use commas or blanks in a variable name. (c) Do not use any special symbol in a variable name except underscore (d) It is better to use short variable name for C compiler. (less than 31 character). Rules for Constructing Variables ….. Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
  • 8. Data Types Data types Range length (bytes) format signed char -128 to + 127 1 %c unsigned char 0 to 255 1 %c short signed int -32768 to +32767 2 %d short unsigned int 0 to 65535 2 %u signed int -32768 to +32767 2 %d unsigned int 0 to 65535 2 %u long signed int -2147483648 to +2147483647 4 %ld long unsigned int 0 to 4294967295 4 %lu float -3.4e38 to +3.4e38 4 %f double -1.7e308 to +1.7e308 8 %lf long double -1.7e4932 to +1.7e4932 10 %Lf Example of Data type with Variables at the time of input and output Data Types printf() scanf() int a,b; printf(“%d %d”,a,b); scanf(“%d %d”,&a,&b); float a,b; printf(“%f %f”,a,b); scanf(“%f %f”,&a,&b); char a,b; printf(“%c %c”,a,b); scanf(“%c %c”,&a,&b); Data types of C language….. Data types Range, Length and format….. Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
  • 9. Sourav Ganguly Please visit my Youtube channel Step 1: go to www.google.com Step 2: Search for “sourav ganguly c programming”. Step 3: Click on my image bottom of the video. You will reach my channel. Youtube (direct link): https://www.youtube.com/channel/UCDsQskBhM107VIYLjg8kczg Website: http://www.startselfstudy.blogspot.in Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
  • 10. Sourav Ganguly Please visit my Youtube channel Step 1: go to www.google.com Step 2: Search for “sourav ganguly c programming”. Step 3: Click on my image bottom of the video. You will reach my channel. Youtube (direct link): https://www.youtube.com/channel/UCDsQskBhM107VIYLjg8kczg Website: http://www.startselfstudy.blogspot.in Copyright © 2015 · Sourav Ganguly · All Rights Reserved.