SlideShare a Scribd company logo
Programming
Fundamentals
C- Data Types
Outlines
• Data Type
• Integer, long and short
• Integer, signed and unsigned
• Char
• Double
Data Type:
• In the C programming language, data types
refer to an extensive system used for
declaring variables or functions of different
types.
• The type of a variable determines how much
space it occupies in storage and how the bit
pattern stored is interpreted.
Integer, long and short:
• We had seen earlier that that the range of an
Integer constant depends
upon the compiler. For a 16-bit compiler like
Turbo C or Turbo
C++ the range is –32768 to 32767.
• For a 32-bit compiler the range
would be –2147483648 to +2147483647.
• Here a 16-bit compiler means that when it
compiles a C program it generates machine
language code that is targeted towards working
on a 16-bit microprocessor like Intel
8086/8088. As against this, a 32-bit
compiler like VC++ generates machine language
code that is targeted towards a 32-bit
microprocessor like Intel Pentium. Note
that this does not mean that a program
• Note that this does not mean that a program
compiled using Turbo C
would not work on 32-bit processor.
• It would run successfully on 32-bit processor.
16-bit processor: 32-bit processor:
• shorts are at least 2 bytes big.
• longs are at least 4 bytes big.
• shorts are never bigger than ints.
• ints are never bigger than longs.
• This figure shows the size of different integers
based upon the OS used:
• Its format string is %u.
Example:
• C allows the abbreviation of short int to
short and of long int to
long. So the declarations made above can be
written as,
long i ;
long abc ;
short j ;
short height ;
Integer, signed and unsigned
• A standard C integer data type (‘int’) is
signed.
• Sometimes, we know in advance that the
value stored in a given
integer variable will always be positive, when
it is being used to only count things, for
example. In such a case we can declare the
variable to be unsigned, as in,
unsigned int num_students ;
• With such a declaration, the range of
permissible integer values
(for a 16-bit OS) will shift from the range -
32768 to +32767 to the
range 0 to 65535. Thus, declaring an integer as
unsigned almost
doubles the size of the largest possible value
that it can otherwise
take.
• Note that an unsigned integer still occupies
two bytes. This is how an unsigned integer can
be declared:
unsigned int i ;
unsigned i ;
• The keyword is unsigned int and 2 bytes
required, its range is 0 to 65535 and its
format string is %u.
• Its example is:
unsigned i ;
scanf(“%u”,&i);
Char:
• To assign, or store a character value we use
“char” data type.
• In C-language the keyword of Character data
type is “char”.
• It requires 1 byte in memory.
• Its range is -128 to +127.
• Its format string is %c.
Example:
Output:
ASCII Codes:
• ASCII abbreviated from American Standard
Code for Information Interchange, also
known as US-ASCII, is a character-encoding
scheme. Originally based on the English
alphabet, it encodes 128 specified characters
into 7-bit binary integers.
Double:
• C-language offers a double data type
that occupies 8 bytes in memory and has a
range from -1.7e308 to
+1.7e308. A variable of type double can be
declared as,
double a, population ;
• In C-language its keyword is “double”.
• It requires 8 bytes in memory.
• Its format string is “%lf”.
• Its example is
double a, population ;
Scanf(“%lf%lf”,&a,&population);
Conclusion:
• First of all we discussed about Data
Types and then various Data types like
int, short, long, signed, unsigned
double, char.
• All about the Data Types their format
strings.
• Then took a little view of ASSCII codes.
Thank you for
concentration…
Prepared by: Muhammad Faizan Akhter

More Related Content

What's hot

Mesics lecture 3 c – constants and variables
Mesics lecture 3   c – constants and variablesMesics lecture 3   c – constants and variables
Mesics lecture 3 c – constants and variables
eShikshak
 
Tokens in C++
Tokens in C++Tokens in C++
Tokens in C++
Mahender Boda
 
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
Kamal Acharya
 
C programming unit 01
C programming unit 01C programming unit 01
C programming unit 01
Prashanth Shivakumar
 
About size_t and ptrdiff_t
About size_t and ptrdiff_tAbout size_t and ptrdiff_t
About size_t and ptrdiff_t
PVS-Studio
 
Object reusability in python
Object reusability in pythonObject reusability in python
Object reusability in python
Learnbay Datascience
 
Source coding
Source coding Source coding
Source coding
Shankar Gangaju
 
Data type in c
Data type in cData type in c
Data type in c
thirumalaikumar3
 
C++
C++C++
Constants variables data_types
Constants variables data_typesConstants variables data_types
Constants variables data_types
NAVEEN SHARMA'S CLASSROOM
 
Two-way Deterministic Finite Automata
Two-way Deterministic Finite AutomataTwo-way Deterministic Finite Automata
Two-way Deterministic Finite Automata
Hafsa.Naseem
 
Lecture02(constants, variable & data types)
Lecture02(constants, variable & data types)Lecture02(constants, variable & data types)
Lecture02(constants, variable & data types)
Dhaka University of Engineering & Technology(DUET)
 
1 puc programming using c++
1 puc programming using c++1 puc programming using c++
1 puc programming using c++
Prof. Dr. K. Adisesha
 
Operators in C Programming
Operators in C ProgrammingOperators in C Programming
Operators in C Programming
Qazi Shahzad Ali
 

What's hot (14)

Mesics lecture 3 c – constants and variables
Mesics lecture 3   c – constants and variablesMesics lecture 3   c – constants and variables
Mesics lecture 3 c – constants and variables
 
Tokens in C++
Tokens in C++Tokens in C++
Tokens 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 Programming
 
C programming unit 01
C programming unit 01C programming unit 01
C programming unit 01
 
About size_t and ptrdiff_t
About size_t and ptrdiff_tAbout size_t and ptrdiff_t
About size_t and ptrdiff_t
 
Object reusability in python
Object reusability in pythonObject reusability in python
Object reusability in python
 
Source coding
Source coding Source coding
Source coding
 
Data type in c
Data type in cData type in c
Data type in c
 
C++
C++C++
C++
 
Constants variables data_types
Constants variables data_typesConstants variables data_types
Constants variables data_types
 
Two-way Deterministic Finite Automata
Two-way Deterministic Finite AutomataTwo-way Deterministic Finite Automata
Two-way Deterministic Finite Automata
 
Lecture02(constants, variable & data types)
Lecture02(constants, variable & data types)Lecture02(constants, variable & data types)
Lecture02(constants, variable & data types)
 
1 puc programming using c++
1 puc programming using c++1 puc programming using c++
1 puc programming using c++
 
Operators in C Programming
Operators in C ProgrammingOperators in C Programming
Operators in C Programming
 

Viewers also liked

Cuestionario 1
Cuestionario 1Cuestionario 1
Cuestionario 1
tavaracarlos
 
Geología general1
Geología general1Geología general1
Geología general1
Daniel Lopez Hormazabal
 
Mehr zu tun, mehr zu sehen warum sie ihren träumen folgen sollten
Mehr zu tun, mehr zu sehen warum sie ihren träumen folgen solltenMehr zu tun, mehr zu sehen warum sie ihren träumen folgen sollten
Mehr zu tun, mehr zu sehen warum sie ihren träumen folgen solltenSunny254
 
JR RESUME
JR RESUMEJR RESUME
JR RESUME
Jerome Arceta
 
SKT Social Manager_임소현
SKT Social Manager_임소현SKT Social Manager_임소현
SKT Social Manager_임소현SoHyun Bonnie Lim
 
Technology consulting services
Technology consulting servicesTechnology consulting services
Technology consulting services
Waseem Khan
 
Spring seminar reflection 1
Spring seminar reflection 1Spring seminar reflection 1
Spring seminar reflection 1
gustavomartinezmuniz
 
WATTS Conference- Water Conservation Education
WATTS Conference- Water Conservation EducationWATTS Conference- Water Conservation Education
WATTS Conference- Water Conservation Education
High Plains UWCD
 
Malformaciones congenitas de pulmon
Malformaciones congenitas de pulmonMalformaciones congenitas de pulmon
Malformaciones congenitas de pulmon
Genry German Aguilar Tacusi
 
CV Oprescu Louis EN 2015
CV Oprescu Louis EN 2015CV Oprescu Louis EN 2015
CV Oprescu Louis EN 2015
Louis Oprescu
 
Job Resume DT
Job Resume DTJob Resume DT
Job Resume DT
Daniel Twogood
 

Viewers also liked (12)

Cuestionario 1
Cuestionario 1Cuestionario 1
Cuestionario 1
 
Geología general1
Geología general1Geología general1
Geología general1
 
Mehr zu tun, mehr zu sehen warum sie ihren träumen folgen sollten
Mehr zu tun, mehr zu sehen warum sie ihren träumen folgen solltenMehr zu tun, mehr zu sehen warum sie ihren träumen folgen sollten
Mehr zu tun, mehr zu sehen warum sie ihren träumen folgen sollten
 
JR RESUME
JR RESUMEJR RESUME
JR RESUME
 
SKT Social Manager_임소현
SKT Social Manager_임소현SKT Social Manager_임소현
SKT Social Manager_임소현
 
Technology consulting services
Technology consulting servicesTechnology consulting services
Technology consulting services
 
Slide
SlideSlide
Slide
 
Spring seminar reflection 1
Spring seminar reflection 1Spring seminar reflection 1
Spring seminar reflection 1
 
WATTS Conference- Water Conservation Education
WATTS Conference- Water Conservation EducationWATTS Conference- Water Conservation Education
WATTS Conference- Water Conservation Education
 
Malformaciones congenitas de pulmon
Malformaciones congenitas de pulmonMalformaciones congenitas de pulmon
Malformaciones congenitas de pulmon
 
CV Oprescu Louis EN 2015
CV Oprescu Louis EN 2015CV Oprescu Louis EN 2015
CV Oprescu Louis EN 2015
 
Job Resume DT
Job Resume DTJob Resume DT
Job Resume DT
 

Similar to Data types slides by Faixan

[ITP - Lecture 05] Datatypes
[ITP - Lecture 05] Datatypes[ITP - Lecture 05] Datatypes
[ITP - Lecture 05] Datatypes
Muhammad Hammad Waseem
 
programming week 2.ppt
programming week 2.pptprogramming week 2.ppt
programming week 2.ppt
FatimaZafar68
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
marvellous2
 
C language
C languageC language
C language
Rupanshi rawat
 
DATATYPES,KEYWORDS,FORMATSPECS[1].pptx
DATATYPES,KEYWORDS,FORMATSPECS[1].pptxDATATYPES,KEYWORDS,FORMATSPECS[1].pptx
DATATYPES,KEYWORDS,FORMATSPECS[1].pptx
LECO9
 
DATATYPES,KEYWORDS,FORMATSPECS[1].pptx
DATATYPES,KEYWORDS,FORMATSPECS[1].pptxDATATYPES,KEYWORDS,FORMATSPECS[1].pptx
DATATYPES,KEYWORDS,FORMATSPECS[1].pptx
SKUP1
 
FUNDAMENTAL OF C
FUNDAMENTAL OF CFUNDAMENTAL OF C
FUNDAMENTAL OF C
KRUNAL RAVAL
 
A Closer Look at Data Types, Variables and Expressions
A Closer Look at Data Types, Variables and ExpressionsA Closer Look at Data Types, Variables and Expressions
A Closer Look at Data Types, Variables and Expressions
Inan Mashrur
 
INTRODUCTION TO C PROGRAMMING in basic c language
INTRODUCTION TO C PROGRAMMING in basic c languageINTRODUCTION TO C PROGRAMMING in basic c language
INTRODUCTION TO C PROGRAMMING in basic c language
GOKULKANNANMMECLECTC
 
C programming language
C programming languageC programming language
C programming language
Abin Rimal
 
lec 2.pptx
lec 2.pptxlec 2.pptx
lec 2.pptx
AhsanAli64749
 
Variables in C and C++ Language
Variables in C and C++ LanguageVariables in C and C++ Language
Variables in C and C++ Language
Way2itech
 
C programming
C programming C programming
C programming
AsifRahaman16
 
FP 201 Unit 2 - Part 2
FP 201 Unit 2 - Part 2FP 201 Unit 2 - Part 2
FP 201 Unit 2 - Part 2
rohassanie
 
Structure of c_program_to_input_output
Structure of c_program_to_input_outputStructure of c_program_to_input_output
Structure of c_program_to_input_output
Anil Dutt
 
CS4443 - Modern Programming Language - I Lecture (2)
CS4443 - Modern Programming Language - I  Lecture (2)CS4443 - Modern Programming Language - I  Lecture (2)
CS4443 - Modern Programming Language - I Lecture (2)
Dilawar Khan
 
C PROGRAMING.pptx
C PROGRAMING.pptxC PROGRAMING.pptx
C PROGRAMING.pptx
MohammedtajuddinTaju
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
Mahfuzur Rahman
 
Data structure & Algorithms - Programming in C
Data structure & Algorithms - Programming in CData structure & Algorithms - Programming in C
Data structure & Algorithms - Programming in C
babuk110
 
INTRODUCTION TO C++.pptx
INTRODUCTION TO C++.pptxINTRODUCTION TO C++.pptx
INTRODUCTION TO C++.pptx
MamataAnilgod
 

Similar to Data types slides by Faixan (20)

[ITP - Lecture 05] Datatypes
[ITP - Lecture 05] Datatypes[ITP - Lecture 05] Datatypes
[ITP - Lecture 05] Datatypes
 
programming week 2.ppt
programming week 2.pptprogramming week 2.ppt
programming week 2.ppt
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
C language
C languageC language
C language
 
DATATYPES,KEYWORDS,FORMATSPECS[1].pptx
DATATYPES,KEYWORDS,FORMATSPECS[1].pptxDATATYPES,KEYWORDS,FORMATSPECS[1].pptx
DATATYPES,KEYWORDS,FORMATSPECS[1].pptx
 
DATATYPES,KEYWORDS,FORMATSPECS[1].pptx
DATATYPES,KEYWORDS,FORMATSPECS[1].pptxDATATYPES,KEYWORDS,FORMATSPECS[1].pptx
DATATYPES,KEYWORDS,FORMATSPECS[1].pptx
 
FUNDAMENTAL OF C
FUNDAMENTAL OF CFUNDAMENTAL OF C
FUNDAMENTAL OF C
 
A Closer Look at Data Types, Variables and Expressions
A Closer Look at Data Types, Variables and ExpressionsA Closer Look at Data Types, Variables and Expressions
A Closer Look at Data Types, Variables and Expressions
 
INTRODUCTION TO C PROGRAMMING in basic c language
INTRODUCTION TO C PROGRAMMING in basic c languageINTRODUCTION TO C PROGRAMMING in basic c language
INTRODUCTION TO C PROGRAMMING in basic c language
 
C programming language
C programming languageC programming language
C programming language
 
lec 2.pptx
lec 2.pptxlec 2.pptx
lec 2.pptx
 
Variables in C and C++ Language
Variables in C and C++ LanguageVariables in C and C++ Language
Variables in C and C++ Language
 
C programming
C programming C programming
C programming
 
FP 201 Unit 2 - Part 2
FP 201 Unit 2 - Part 2FP 201 Unit 2 - Part 2
FP 201 Unit 2 - Part 2
 
Structure of c_program_to_input_output
Structure of c_program_to_input_outputStructure of c_program_to_input_output
Structure of c_program_to_input_output
 
CS4443 - Modern Programming Language - I Lecture (2)
CS4443 - Modern Programming Language - I  Lecture (2)CS4443 - Modern Programming Language - I  Lecture (2)
CS4443 - Modern Programming Language - I Lecture (2)
 
C PROGRAMING.pptx
C PROGRAMING.pptxC PROGRAMING.pptx
C PROGRAMING.pptx
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
Data structure & Algorithms - Programming in C
Data structure & Algorithms - Programming in CData structure & Algorithms - Programming in C
Data structure & Algorithms - Programming in C
 
INTRODUCTION TO C++.pptx
INTRODUCTION TO C++.pptxINTRODUCTION TO C++.pptx
INTRODUCTION TO C++.pptx
 

More from ٖFaiXy :)

Road to hell is paved with good intentions... Dedicated to my sweet sister Pa...
Road to hell is paved with good intentions... Dedicated to my sweet sister Pa...Road to hell is paved with good intentions... Dedicated to my sweet sister Pa...
Road to hell is paved with good intentions... Dedicated to my sweet sister Pa...
ٖFaiXy :)
 
Emraan Hashmi
Emraan Hashmi Emraan Hashmi
Emraan Hashmi
ٖFaiXy :)
 
Printers by tahir ijaz
Printers by tahir ijazPrinters by tahir ijaz
Printers by tahir ijaz
ٖFaiXy :)
 
William shakespeare by faixan
William shakespeare by faixanWilliam shakespeare by faixan
William shakespeare by faixan
ٖFaiXy :)
 
File handling in C by Faixan
File handling in C by FaixanFile handling in C by Faixan
File handling in C by Faixan
ٖFaiXy :)
 
Globalization by Faixan
Globalization by FaixanGlobalization by Faixan
Globalization by Faixan
ٖFaiXy :)
 
Operating systems by faixan
Operating systems by faixanOperating systems by faixan
Operating systems by faixan
ٖFaiXy :)
 
Printers by Faixan
Printers by Faixan Printers by Faixan
Printers by Faixan
ٖFaiXy :)
 

More from ٖFaiXy :) (8)

Road to hell is paved with good intentions... Dedicated to my sweet sister Pa...
Road to hell is paved with good intentions... Dedicated to my sweet sister Pa...Road to hell is paved with good intentions... Dedicated to my sweet sister Pa...
Road to hell is paved with good intentions... Dedicated to my sweet sister Pa...
 
Emraan Hashmi
Emraan Hashmi Emraan Hashmi
Emraan Hashmi
 
Printers by tahir ijaz
Printers by tahir ijazPrinters by tahir ijaz
Printers by tahir ijaz
 
William shakespeare by faixan
William shakespeare by faixanWilliam shakespeare by faixan
William shakespeare by faixan
 
File handling in C by Faixan
File handling in C by FaixanFile handling in C by Faixan
File handling in C by Faixan
 
Globalization by Faixan
Globalization by FaixanGlobalization by Faixan
Globalization by Faixan
 
Operating systems by faixan
Operating systems by faixanOperating systems by faixan
Operating systems by faixan
 
Printers by Faixan
Printers by Faixan Printers by Faixan
Printers by Faixan
 

Recently uploaded

openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
Hironori Washizaki
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
lorraineandreiamcidl
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Envertis Software Solutions
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
pavan998932
 

Recently uploaded (20)

openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
 

Data types slides by Faixan

  • 2. Outlines • Data Type • Integer, long and short • Integer, signed and unsigned • Char • Double
  • 3. Data Type: • In the C programming language, data types refer to an extensive system used for declaring variables or functions of different types. • The type of a variable determines how much space it occupies in storage and how the bit pattern stored is interpreted.
  • 4. Integer, long and short: • We had seen earlier that that the range of an Integer constant depends upon the compiler. For a 16-bit compiler like Turbo C or Turbo C++ the range is –32768 to 32767.
  • 5. • For a 32-bit compiler the range would be –2147483648 to +2147483647. • Here a 16-bit compiler means that when it compiles a C program it generates machine language code that is targeted towards working on a 16-bit microprocessor like Intel 8086/8088. As against this, a 32-bit compiler like VC++ generates machine language code that is targeted towards a 32-bit microprocessor like Intel Pentium. Note that this does not mean that a program
  • 6. • Note that this does not mean that a program compiled using Turbo C would not work on 32-bit processor. • It would run successfully on 32-bit processor. 16-bit processor: 32-bit processor:
  • 7. • shorts are at least 2 bytes big. • longs are at least 4 bytes big. • shorts are never bigger than ints. • ints are never bigger than longs. • This figure shows the size of different integers based upon the OS used: • Its format string is %u.
  • 8. Example: • C allows the abbreviation of short int to short and of long int to long. So the declarations made above can be written as, long i ; long abc ; short j ; short height ;
  • 9. Integer, signed and unsigned • A standard C integer data type (‘int’) is signed. • Sometimes, we know in advance that the value stored in a given integer variable will always be positive, when it is being used to only count things, for example. In such a case we can declare the variable to be unsigned, as in, unsigned int num_students ;
  • 10. • With such a declaration, the range of permissible integer values (for a 16-bit OS) will shift from the range - 32768 to +32767 to the range 0 to 65535. Thus, declaring an integer as unsigned almost doubles the size of the largest possible value that it can otherwise take. • Note that an unsigned integer still occupies two bytes. This is how an unsigned integer can be declared: unsigned int i ; unsigned i ;
  • 11. • The keyword is unsigned int and 2 bytes required, its range is 0 to 65535 and its format string is %u. • Its example is: unsigned i ; scanf(“%u”,&i);
  • 12. Char: • To assign, or store a character value we use “char” data type. • In C-language the keyword of Character data type is “char”. • It requires 1 byte in memory. • Its range is -128 to +127. • Its format string is %c.
  • 15. ASCII Codes: • ASCII abbreviated from American Standard Code for Information Interchange, also known as US-ASCII, is a character-encoding scheme. Originally based on the English alphabet, it encodes 128 specified characters into 7-bit binary integers.
  • 16. Double: • C-language offers a double data type that occupies 8 bytes in memory and has a range from -1.7e308 to +1.7e308. A variable of type double can be declared as, double a, population ; • In C-language its keyword is “double”. • It requires 8 bytes in memory. • Its format string is “%lf”. • Its example is double a, population ; Scanf(“%lf%lf”,&a,&population);
  • 17. Conclusion: • First of all we discussed about Data Types and then various Data types like int, short, long, signed, unsigned double, char. • All about the Data Types their format strings. • Then took a little view of ASSCII codes.
  • 18. Thank you for concentration… Prepared by: Muhammad Faizan Akhter