SlideShare a Scribd company logo
1 of 12
Subject : CPU(2110003)
Topic – Datatypes in C Language
Branch : Electrical
Div – F Batch : F - 1
Prepared By : Parth Patel
Guided By : Prof. Raxit Jani
• "Data type can be defined as the type of data of
variable or constant store.“
• When we use a variable in a program then we
have to mention the type of data. This can be
handled using data type in C.
• Followings are the most commonly used data
types in C.
PRIMARY
DATATYPE
DERIVED
DATATYPE
USER DEFINED
TYPE
INTEGER
CHAR
FLOAT
VOID
ARRAY
POINTER
STRUCTURE
UNION
TYPEDEF
ENUM
 The void type has no values therefore we cannot
declare it as variable as we did in case of integer
and float.
 The void data type is usually used with function to
specify its type.
Keyword
Format
Specifier
Size Data Range
char %c 1 Byte -128 to +127
unsigned char %c 1 Bytes 0 to 255
int %d 2 Bytes
-32768 to
+32767
long int %ld 4 Bytes -231
to +231
unsigned int %u 2 Bytes 0 to 65535
float %f 4 Bytes
-3.4e38
to
+3.4e38
double %lf 8 Bytes
-1.7e38
to
+1.7e38
long double %Lf 10Bytes
-3.4e38
to
+3.4e38
• C language supports a feature where user can
define an identifier that characterizes an existing
data type.
• This user defined data type identifier can later be
used to declare variables.
• In short its purpose is to redefine the name of an
existing data type.
Syntax:
• typedef <type> <identifier>;
• typedef int marks;
• marks batch1,batch2;
 Syntax-
 enum identifier {value1,value2….valuen};
 The identifier is a user defined enumerated
datatype which helps to declare variables that can
have one of the value enclosed in braces.This is
known as enumeration.
• enum day { mon,tue,wed,thu,fri,sat,sun};
• day week_stat,week_end;
• week_stat = mon;
• week_end = fri;
• if(week_stat == tue)
{
week_end = sat;
}
Datatypes in C Language

More Related Content

What's hot

Datatype introduction- JAVA
Datatype introduction- JAVADatatype introduction- JAVA
Datatype introduction- JAVA
Hamna_sheikh
 
Concept of c data types
Concept of c data typesConcept of c data types
Concept of c data types
Manisha Keim
 

What's hot (20)

Datatype in c++ unit 3 -topic 2
Datatype in c++ unit 3 -topic 2Datatype in c++ unit 3 -topic 2
Datatype in c++ unit 3 -topic 2
 
Oop l3n
Oop l3nOop l3n
Oop l3n
 
Lecture 9 - Machine Learning and Support Vector Machines (SVM)
Lecture 9 - Machine Learning and Support Vector Machines (SVM)Lecture 9 - Machine Learning and Support Vector Machines (SVM)
Lecture 9 - Machine Learning and Support Vector Machines (SVM)
 
Frequently asked tcs technical interview questions and answers
Frequently asked tcs technical interview questions and answersFrequently asked tcs technical interview questions and answers
Frequently asked tcs technical interview questions and answers
 
AINL 2016: Kravchenko
AINL 2016: KravchenkoAINL 2016: Kravchenko
AINL 2016: Kravchenko
 
Data types in Java
Data types in JavaData types in Java
Data types in Java
 
Crash Course in Natural Language Processing (2016)
Crash Course in Natural Language Processing (2016)Crash Course in Natural Language Processing (2016)
Crash Course in Natural Language Processing (2016)
 
Tokens in C++
Tokens in C++Tokens in C++
Tokens in C++
 
Data types in C
Data types in CData types in C
Data types in C
 
Lec9
Lec9Lec9
Lec9
 
Datatype introduction- JAVA
Datatype introduction- JAVADatatype introduction- JAVA
Datatype introduction- JAVA
 
Hua Shan - 2015 - A Dependency-to-String Model for Chinese-Japanese SMT System
Hua Shan - 2015 - A Dependency-to-String Model for Chinese-Japanese SMT SystemHua Shan - 2015 - A Dependency-to-String Model for Chinese-Japanese SMT System
Hua Shan - 2015 - A Dependency-to-String Model for Chinese-Japanese SMT System
 
AINL 2016: Bastrakova, Ledesma, Millan, Zighed
AINL 2016: Bastrakova, Ledesma, Millan, ZighedAINL 2016: Bastrakova, Ledesma, Millan, Zighed
AINL 2016: Bastrakova, Ledesma, Millan, Zighed
 
3 data-types-in-c
3 data-types-in-c3 data-types-in-c
3 data-types-in-c
 
Concept of c data types
Concept of c data typesConcept of c data types
Concept of c data types
 
Topic modelling
Topic modellingTopic modelling
Topic modelling
 
Basic Data Types in C++
Basic Data Types in C++ Basic Data Types in C++
Basic Data Types in C++
 
Programming construction tools
Programming construction toolsProgramming construction tools
Programming construction tools
 
DBMS CS2
DBMS CS2DBMS CS2
DBMS CS2
 
C++
C++C++
C++
 

Similar to Datatypes in C Language

PROGRAMMING IN C- Data Types.pptx
PROGRAMMING IN C- Data Types.pptxPROGRAMMING IN C- Data Types.pptx
PROGRAMMING IN C- Data Types.pptx
Nithya K
 
Zaridah lecture2
Zaridah lecture2Zaridah lecture2
Zaridah lecture2
Aziz Sahat
 
Data Types in C++-Primary or Built-in or Fundamental data type Derived data t...
Data Types in C++-Primary or Built-in or Fundamental data type Derived data t...Data Types in C++-Primary or Built-in or Fundamental data type Derived data t...
Data Types in C++-Primary or Built-in or Fundamental data type Derived data t...
ssuser5610081
 

Similar to Datatypes in C Language (20)

PROGRAMMING IN C- Data Types.pptx
PROGRAMMING IN C- Data Types.pptxPROGRAMMING IN C- Data Types.pptx
PROGRAMMING IN C- Data Types.pptx
 
C language Unit 2 Slides, UPTU C language
C language Unit 2 Slides, UPTU C languageC language Unit 2 Slides, UPTU C language
C language Unit 2 Slides, UPTU C language
 
Data Types in C language
Data Types in C languageData Types in C language
Data Types in C language
 
Datatypes in C++.pptx
Datatypes in C++.pptxDatatypes in C++.pptx
Datatypes in C++.pptx
 
C material
C materialC material
C material
 
Unit 1 Built in Data types in C language.ppt
Unit 1 Built in Data types in C language.pptUnit 1 Built in Data types in C language.ppt
Unit 1 Built in Data types in C language.ppt
 
DIGITAL ELECTRONICS AND LOGIC DESIGN
DIGITAL ELECTRONICS AND LOGIC DESIGN DIGITAL ELECTRONICS AND LOGIC DESIGN
DIGITAL ELECTRONICS AND LOGIC DESIGN
 
Data Type in C Programming
Data Type in C ProgrammingData Type in C Programming
Data Type in C Programming
 
datatypes-200723165518 (1).pptx
datatypes-200723165518 (1).pptxdatatypes-200723165518 (1).pptx
datatypes-200723165518 (1).pptx
 
Data Handling
Data HandlingData Handling
Data Handling
 
lecture 3 bca 1 year.pptx
lecture 3 bca 1 year.pptxlecture 3 bca 1 year.pptx
lecture 3 bca 1 year.pptx
 
DS.pptx
DS.pptxDS.pptx
DS.pptx
 
Zaridah lecture2
Zaridah lecture2Zaridah lecture2
Zaridah lecture2
 
Data Types in C++-Primary or Built-in or Fundamental data type Derived data t...
Data Types in C++-Primary or Built-in or Fundamental data type Derived data t...Data Types in C++-Primary or Built-in or Fundamental data type Derived data t...
Data Types in C++-Primary or Built-in or Fundamental data type Derived data t...
 
5-Lec - Datatypes.ppt
5-Lec - Datatypes.ppt5-Lec - Datatypes.ppt
5-Lec - Datatypes.ppt
 
Python Tutorial Questions part-1
Python Tutorial Questions part-1Python Tutorial Questions part-1
Python Tutorial Questions part-1
 
Data structure & Algorithms - Programming in C
Data structure & Algorithms - Programming in CData structure & Algorithms - Programming in C
Data structure & Algorithms - Programming in C
 
Cp presentation
Cp presentationCp presentation
Cp presentation
 
Chap 2(const var-datatype)
Chap 2(const var-datatype)Chap 2(const var-datatype)
Chap 2(const var-datatype)
 
PSPC--UNIT-2.pdf
PSPC--UNIT-2.pdfPSPC--UNIT-2.pdf
PSPC--UNIT-2.pdf
 

Recently uploaded

Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Kandungan 087776558899
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
mphochane1998
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
HenryBriggs2
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
Health
 

Recently uploaded (20)

Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
Bridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptxBridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptx
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Rums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdfRums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdf
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
Air Compressor reciprocating single stage
Air Compressor reciprocating single stageAir Compressor reciprocating single stage
Air Compressor reciprocating single stage
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal load
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
 

Datatypes in C Language

  • 1. Subject : CPU(2110003) Topic – Datatypes in C Language Branch : Electrical Div – F Batch : F - 1 Prepared By : Parth Patel Guided By : Prof. Raxit Jani
  • 2. • "Data type can be defined as the type of data of variable or constant store.“ • When we use a variable in a program then we have to mention the type of data. This can be handled using data type in C. • Followings are the most commonly used data types in C.
  • 4.
  • 5.
  • 6.  The void type has no values therefore we cannot declare it as variable as we did in case of integer and float.  The void data type is usually used with function to specify its type.
  • 7. Keyword Format Specifier Size Data Range char %c 1 Byte -128 to +127 unsigned char %c 1 Bytes 0 to 255 int %d 2 Bytes -32768 to +32767 long int %ld 4 Bytes -231 to +231 unsigned int %u 2 Bytes 0 to 65535 float %f 4 Bytes -3.4e38 to +3.4e38 double %lf 8 Bytes -1.7e38 to +1.7e38 long double %Lf 10Bytes -3.4e38 to +3.4e38
  • 8. • C language supports a feature where user can define an identifier that characterizes an existing data type. • This user defined data type identifier can later be used to declare variables. • In short its purpose is to redefine the name of an existing data type.
  • 9. Syntax: • typedef <type> <identifier>; • typedef int marks; • marks batch1,batch2;
  • 10.  Syntax-  enum identifier {value1,value2….valuen};  The identifier is a user defined enumerated datatype which helps to declare variables that can have one of the value enclosed in braces.This is known as enumeration.
  • 11. • enum day { mon,tue,wed,thu,fri,sat,sun}; • day week_stat,week_end; • week_stat = mon; • week_end = fri; • if(week_stat == tue) { week_end = sat; }