SlideShare a Scribd company logo
DATA TYPES
IN C PROGRAMMING
PRESENTED BY- AASHU PATEL
What is Data Type?
A Data type is a type of data.
Data type is data storage format that can contain a
specific type or range of values.
Data types in c refers to an extensive system used
for declaring variable for function of different types.
The type of variable determines how much space it
occupies in storage and how the bit pattern stored in
interpreted.
A Data Type Is Used To-
 Identify the type of a variable when the
variable is declared.
 Identify the type of the return value of a
function.
 Identify the type of a parameter expected by a
function.
Data types in c
Data types in c
Primary Derived User Defined
1.Integer
2.Real
3.Character
4.Void
1.Arrays
2.Pointers
1. Structure
2. Union
3. Enumeration
4. Typedef
A. Primary data type
These are fundamental or basic data type in c
namely
1.Integer
2.Real
3.Character
4.Void
1. Integer Data type
Integer are used to store whole number
Type Size(bytes) Range Format specifier
int or signed int 2 -32,768 to +32767 %d
Unsigned int 2 0 to 65535 %d
long int or signed
long int
4 -2,147,483 to
+2,147,483,647
%d
Unsigned long int 4 0 to 4,294,967,295 %lu
2. Real Data Type
Floating types are used to store real numbers.
Type Size(bytes) Range Format specifiers
float 4 3.4X10 -38 to
3.4X10+38
%f
double 8 1.7X10-308 to
1.7X10+308
%if
long double 10 3.4X10-4932 to
3.4X10+4932
%Lf
3. Character Data Type
Character types are used to store character value.
Type Size(bytes) Range Format
specifiers
Char or
signed char
1 -128 to 127 %c
Unsigned char 1 0 to 255 %c
4. Void Data Type
Void type means no value. This is usually used to
specify the type of function which returns nothing
by defining in front of main() or any other function
and as blank arguments within functional backets.
For example-
1. void main()
2.void main(void)
B.Derived Data Type
 Array: An array in c language is a collection of similar data-type,means an
array can hold value of a particular data type for which it has been declared.
Arrays can be created from any of the C data-types int.
 Example: int a[4]={10,20,30,40};
Index/position a[0] a[1] a[2] a[3]
Values
Address in memory 1002 1004 1006
 Pointer : C pointer is a special variable that can be used to store address of
another variable.
10 20 30 40
C. User Defined
1.Structure Data Type
C structure is a collection of different data types which are grouped together and each element in
a C structure is called member.
Example:
Struct student{
int roll no;
char name[20];
char city[20];
}
2.Union Data Type
 It is a package of variables of different types under a single name.
 “union” keyword is used to define a structure.
 The highest bytes of data types will occupy the memory.
e.g. union student
{
int roll no;
char name[10];
float per;
}std;
Structure student will occupy 4 bytes in memory as float is the highest data among int and char.
3. Enumerated Data Type (Enum)
 Enumerated data type is a user defined data type having finite set of enumeration
constant. The keyword “enum” is used to create enumerated data type. Enumeration
data type consists of named integer constants as a list . It start with 0 (zero) by default
and value is incremented by 1 for the sequential identifiers in the list.
Syntax:
Enum [data type] {const1,const2…constn}
Enum example in C:
enum month {Jan, Feb, Mar};or/* Jan,Feb and Mar variables will be assigned to 0,1 and
2 respectively by default */
enum month {Jan = 1, Feb, Mar};/*Feb and Mar variables will be assigned to 2 and 3
respectively by default */
Enum month {Jan = 20, Feb, Mar};/* Jan is assigned to 20. Feb and Mar variables will be
assigned to 21 and 22 respectively by default */
4. Typedef Data Type
It is used to create new data type. But it is commonly used
to change existing data type with another name.
Syntax:
typedef [data_type]new_data_type;
Example:
typedef int integer;
integer roll_no;
THANK YOU FOR YOUR
ATTENTION
Ad

More Related Content

Similar to data types in c programming language in detail (20)

Data Types In C
Data Types In CData Types In C
Data Types In C
Simplilearn
 
Programming Fundamentals lecture 6
Programming Fundamentals lecture 6Programming Fundamentals lecture 6
Programming Fundamentals lecture 6
REHAN IJAZ
 
DATA TYPES IN C Language.pptx
DATA TYPES IN C Language.pptxDATA TYPES IN C Language.pptx
DATA TYPES IN C Language.pptx
karansethi63
 
Data types
Data typesData types
Data types
Sachin Satwaskar
 
Unit 3(Arrays).pptx arrays topics in the c lang
Unit 3(Arrays).pptx arrays topics in the c langUnit 3(Arrays).pptx arrays topics in the c lang
Unit 3(Arrays).pptx arrays topics in the c lang
meesalasrinuvasuraon
 
C PROGRAMMING LANGUAGE
C  PROGRAMMING  LANGUAGEC  PROGRAMMING  LANGUAGE
C PROGRAMMING LANGUAGE
PRASANYA K
 
datatypes-200723165518 (1).pptx
datatypes-200723165518 (1).pptxdatatypes-200723165518 (1).pptx
datatypes-200723165518 (1).pptx
NaniBhai3
 
5-Lec - Datatypes.ppt
5-Lec - Datatypes.ppt5-Lec - Datatypes.ppt
5-Lec - Datatypes.ppt
AqeelAbbas94
 
Data Types - Premetive and Non Premetive
Data Types - Premetive and Non Premetive Data Types - Premetive and Non Premetive
Data Types - Premetive and Non Premetive
Raj Naik
 
Data types
Data typesData types
Data types
Dr. Rupinder Singh
 
arrays and pointers
arrays and pointersarrays and pointers
arrays and pointers
Samiksha Pun
 
Basic Data Types in C++
Basic Data Types in C++ Basic Data Types in C++
Basic Data Types in C++
Hridoy Bepari
 
Fundamental of C Programming (Data Types)
Fundamental of C Programming (Data Types)Fundamental of C Programming (Data Types)
Fundamental of C Programming (Data Types)
jimmy majumder
 
Basic C programming Language - Unit 1.pptx
Basic C programming Language - Unit 1.pptxBasic C programming Language - Unit 1.pptx
Basic C programming Language - Unit 1.pptx
Margaret Mary
 
arraytypes of array and pointer string in c++.pptx
arraytypes of array and pointer string in c++.pptxarraytypes of array and pointer string in c++.pptx
arraytypes of array and pointer string in c++.pptx
harinipradeep15
 
cassignmentii-170424105623.pdf
cassignmentii-170424105623.pdfcassignmentii-170424105623.pdf
cassignmentii-170424105623.pdf
YRABHI
 
data types in C programming
data types in C programmingdata types in C programming
data types in C programming
Harshita Yadav
 
Computer science ( Structures In C ) Ppt
Computer science  ( Structures  In C ) PptComputer science  ( Structures  In C ) Ppt
Computer science ( Structures In C ) Ppt
SobhitRanjanPanda
 
Data type
Data typeData type
Data type
Unviersity of balochistan quetta
 
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
pubgnewstate1620
 
Programming Fundamentals lecture 6
Programming Fundamentals lecture 6Programming Fundamentals lecture 6
Programming Fundamentals lecture 6
REHAN IJAZ
 
DATA TYPES IN C Language.pptx
DATA TYPES IN C Language.pptxDATA TYPES IN C Language.pptx
DATA TYPES IN C Language.pptx
karansethi63
 
Unit 3(Arrays).pptx arrays topics in the c lang
Unit 3(Arrays).pptx arrays topics in the c langUnit 3(Arrays).pptx arrays topics in the c lang
Unit 3(Arrays).pptx arrays topics in the c lang
meesalasrinuvasuraon
 
C PROGRAMMING LANGUAGE
C  PROGRAMMING  LANGUAGEC  PROGRAMMING  LANGUAGE
C PROGRAMMING LANGUAGE
PRASANYA K
 
datatypes-200723165518 (1).pptx
datatypes-200723165518 (1).pptxdatatypes-200723165518 (1).pptx
datatypes-200723165518 (1).pptx
NaniBhai3
 
5-Lec - Datatypes.ppt
5-Lec - Datatypes.ppt5-Lec - Datatypes.ppt
5-Lec - Datatypes.ppt
AqeelAbbas94
 
Data Types - Premetive and Non Premetive
Data Types - Premetive and Non Premetive Data Types - Premetive and Non Premetive
Data Types - Premetive and Non Premetive
Raj Naik
 
arrays and pointers
arrays and pointersarrays and pointers
arrays and pointers
Samiksha Pun
 
Basic Data Types in C++
Basic Data Types in C++ Basic Data Types in C++
Basic Data Types in C++
Hridoy Bepari
 
Fundamental of C Programming (Data Types)
Fundamental of C Programming (Data Types)Fundamental of C Programming (Data Types)
Fundamental of C Programming (Data Types)
jimmy majumder
 
Basic C programming Language - Unit 1.pptx
Basic C programming Language - Unit 1.pptxBasic C programming Language - Unit 1.pptx
Basic C programming Language - Unit 1.pptx
Margaret Mary
 
arraytypes of array and pointer string in c++.pptx
arraytypes of array and pointer string in c++.pptxarraytypes of array and pointer string in c++.pptx
arraytypes of array and pointer string in c++.pptx
harinipradeep15
 
cassignmentii-170424105623.pdf
cassignmentii-170424105623.pdfcassignmentii-170424105623.pdf
cassignmentii-170424105623.pdf
YRABHI
 
data types in C programming
data types in C programmingdata types in C programming
data types in C programming
Harshita Yadav
 
Computer science ( Structures In C ) Ppt
Computer science  ( Structures  In C ) PptComputer science  ( Structures  In C ) Ppt
Computer science ( Structures In C ) Ppt
SobhitRanjanPanda
 
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
pubgnewstate1620
 

Recently uploaded (20)

How to Troubleshoot 9 Types of OutOfMemoryError
How to Troubleshoot 9 Types of OutOfMemoryErrorHow to Troubleshoot 9 Types of OutOfMemoryError
How to Troubleshoot 9 Types of OutOfMemoryError
Tier1 app
 
AI in Business Software: Smarter Systems or Hidden Risks?
AI in Business Software: Smarter Systems or Hidden Risks?AI in Business Software: Smarter Systems or Hidden Risks?
AI in Business Software: Smarter Systems or Hidden Risks?
Amara Nielson
 
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptxThe-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
james brownuae
 
Adobe InDesign Crack FREE Download 2025 link
Adobe InDesign Crack FREE Download 2025 linkAdobe InDesign Crack FREE Download 2025 link
Adobe InDesign Crack FREE Download 2025 link
mahmadzubair09
 
Medical Device Cybersecurity Threat & Risk Scoring
Medical Device Cybersecurity Threat & Risk ScoringMedical Device Cybersecurity Threat & Risk Scoring
Medical Device Cybersecurity Threat & Risk Scoring
ICS
 
Wilcom Embroidery Studio Crack Free Latest 2025
Wilcom Embroidery Studio Crack Free Latest 2025Wilcom Embroidery Studio Crack Free Latest 2025
Wilcom Embroidery Studio Crack Free Latest 2025
Web Designer
 
What Do Candidates Really Think About AI-Powered Recruitment Tools?
What Do Candidates Really Think About AI-Powered Recruitment Tools?What Do Candidates Really Think About AI-Powered Recruitment Tools?
What Do Candidates Really Think About AI-Powered Recruitment Tools?
HireME
 
Sequence Diagrams With Pictures (1).pptx
Sequence Diagrams With Pictures (1).pptxSequence Diagrams With Pictures (1).pptx
Sequence Diagrams With Pictures (1).pptx
aashrithakondapalli8
 
Why Tapitag Ranks Among the Best Digital Business Card Providers
Why Tapitag Ranks Among the Best Digital Business Card ProvidersWhy Tapitag Ranks Among the Best Digital Business Card Providers
Why Tapitag Ranks Among the Best Digital Business Card Providers
Tapitag
 
Wilcom Embroidery Studio Crack 2025 For Windows
Wilcom Embroidery Studio Crack 2025 For WindowsWilcom Embroidery Studio Crack 2025 For Windows
Wilcom Embroidery Studio Crack 2025 For Windows
Google
 
Serato DJ Pro Crack Latest Version 2025??
Serato DJ Pro Crack Latest Version 2025??Serato DJ Pro Crack Latest Version 2025??
Serato DJ Pro Crack Latest Version 2025??
Web Designer
 
Gojek Clone App for Multi-Service Business
Gojek Clone App for Multi-Service BusinessGojek Clone App for Multi-Service Business
Gojek Clone App for Multi-Service Business
XongoLab Technologies LLP
 
[gbgcpp] Let's get comfortable with concepts
[gbgcpp] Let's get comfortable with concepts[gbgcpp] Let's get comfortable with concepts
[gbgcpp] Let's get comfortable with concepts
Dimitrios Platis
 
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World ExamplesMastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
jamescantor38
 
From Vibe Coding to Vibe Testing - Complete PowerPoint Presentation
From Vibe Coding to Vibe Testing - Complete PowerPoint PresentationFrom Vibe Coding to Vibe Testing - Complete PowerPoint Presentation
From Vibe Coding to Vibe Testing - Complete PowerPoint Presentation
Shay Ginsbourg
 
Autodesk Inventor Crack (2025) Latest
Autodesk Inventor    Crack (2025) LatestAutodesk Inventor    Crack (2025) Latest
Autodesk Inventor Crack (2025) Latest
Google
 
Programs as Values - Write code and don't get lost
Programs as Values - Write code and don't get lostPrograms as Values - Write code and don't get lost
Programs as Values - Write code and don't get lost
Pierangelo Cecchetto
 
Top 12 Most Useful AngularJS Development Tools to Use in 2025
Top 12 Most Useful AngularJS Development Tools to Use in 2025Top 12 Most Useful AngularJS Development Tools to Use in 2025
Top 12 Most Useful AngularJS Development Tools to Use in 2025
GrapesTech Solutions
 
Best HR and Payroll Software in Bangladesh - accordHRM
Best HR and Payroll Software in Bangladesh - accordHRMBest HR and Payroll Software in Bangladesh - accordHRM
Best HR and Payroll Software in Bangladesh - accordHRM
accordHRM
 
Buy vs. Build: Unlocking the right path for your training tech
Buy vs. Build: Unlocking the right path for your training techBuy vs. Build: Unlocking the right path for your training tech
Buy vs. Build: Unlocking the right path for your training tech
Rustici Software
 
How to Troubleshoot 9 Types of OutOfMemoryError
How to Troubleshoot 9 Types of OutOfMemoryErrorHow to Troubleshoot 9 Types of OutOfMemoryError
How to Troubleshoot 9 Types of OutOfMemoryError
Tier1 app
 
AI in Business Software: Smarter Systems or Hidden Risks?
AI in Business Software: Smarter Systems or Hidden Risks?AI in Business Software: Smarter Systems or Hidden Risks?
AI in Business Software: Smarter Systems or Hidden Risks?
Amara Nielson
 
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptxThe-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
james brownuae
 
Adobe InDesign Crack FREE Download 2025 link
Adobe InDesign Crack FREE Download 2025 linkAdobe InDesign Crack FREE Download 2025 link
Adobe InDesign Crack FREE Download 2025 link
mahmadzubair09
 
Medical Device Cybersecurity Threat & Risk Scoring
Medical Device Cybersecurity Threat & Risk ScoringMedical Device Cybersecurity Threat & Risk Scoring
Medical Device Cybersecurity Threat & Risk Scoring
ICS
 
Wilcom Embroidery Studio Crack Free Latest 2025
Wilcom Embroidery Studio Crack Free Latest 2025Wilcom Embroidery Studio Crack Free Latest 2025
Wilcom Embroidery Studio Crack Free Latest 2025
Web Designer
 
What Do Candidates Really Think About AI-Powered Recruitment Tools?
What Do Candidates Really Think About AI-Powered Recruitment Tools?What Do Candidates Really Think About AI-Powered Recruitment Tools?
What Do Candidates Really Think About AI-Powered Recruitment Tools?
HireME
 
Sequence Diagrams With Pictures (1).pptx
Sequence Diagrams With Pictures (1).pptxSequence Diagrams With Pictures (1).pptx
Sequence Diagrams With Pictures (1).pptx
aashrithakondapalli8
 
Why Tapitag Ranks Among the Best Digital Business Card Providers
Why Tapitag Ranks Among the Best Digital Business Card ProvidersWhy Tapitag Ranks Among the Best Digital Business Card Providers
Why Tapitag Ranks Among the Best Digital Business Card Providers
Tapitag
 
Wilcom Embroidery Studio Crack 2025 For Windows
Wilcom Embroidery Studio Crack 2025 For WindowsWilcom Embroidery Studio Crack 2025 For Windows
Wilcom Embroidery Studio Crack 2025 For Windows
Google
 
Serato DJ Pro Crack Latest Version 2025??
Serato DJ Pro Crack Latest Version 2025??Serato DJ Pro Crack Latest Version 2025??
Serato DJ Pro Crack Latest Version 2025??
Web Designer
 
[gbgcpp] Let's get comfortable with concepts
[gbgcpp] Let's get comfortable with concepts[gbgcpp] Let's get comfortable with concepts
[gbgcpp] Let's get comfortable with concepts
Dimitrios Platis
 
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World ExamplesMastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
jamescantor38
 
From Vibe Coding to Vibe Testing - Complete PowerPoint Presentation
From Vibe Coding to Vibe Testing - Complete PowerPoint PresentationFrom Vibe Coding to Vibe Testing - Complete PowerPoint Presentation
From Vibe Coding to Vibe Testing - Complete PowerPoint Presentation
Shay Ginsbourg
 
Autodesk Inventor Crack (2025) Latest
Autodesk Inventor    Crack (2025) LatestAutodesk Inventor    Crack (2025) Latest
Autodesk Inventor Crack (2025) Latest
Google
 
Programs as Values - Write code and don't get lost
Programs as Values - Write code and don't get lostPrograms as Values - Write code and don't get lost
Programs as Values - Write code and don't get lost
Pierangelo Cecchetto
 
Top 12 Most Useful AngularJS Development Tools to Use in 2025
Top 12 Most Useful AngularJS Development Tools to Use in 2025Top 12 Most Useful AngularJS Development Tools to Use in 2025
Top 12 Most Useful AngularJS Development Tools to Use in 2025
GrapesTech Solutions
 
Best HR and Payroll Software in Bangladesh - accordHRM
Best HR and Payroll Software in Bangladesh - accordHRMBest HR and Payroll Software in Bangladesh - accordHRM
Best HR and Payroll Software in Bangladesh - accordHRM
accordHRM
 
Buy vs. Build: Unlocking the right path for your training tech
Buy vs. Build: Unlocking the right path for your training techBuy vs. Build: Unlocking the right path for your training tech
Buy vs. Build: Unlocking the right path for your training tech
Rustici Software
 
Ad

data types in c programming language in detail

  • 1. DATA TYPES IN C PROGRAMMING PRESENTED BY- AASHU PATEL
  • 2. What is Data Type? A Data type is a type of data. Data type is data storage format that can contain a specific type or range of values. Data types in c refers to an extensive system used for declaring variable for function of different types. The type of variable determines how much space it occupies in storage and how the bit pattern stored in interpreted.
  • 3. A Data Type Is Used To-  Identify the type of a variable when the variable is declared.  Identify the type of the return value of a function.  Identify the type of a parameter expected by a function.
  • 4. Data types in c Data types in c Primary Derived User Defined 1.Integer 2.Real 3.Character 4.Void 1.Arrays 2.Pointers 1. Structure 2. Union 3. Enumeration 4. Typedef
  • 5. A. Primary data type These are fundamental or basic data type in c namely 1.Integer 2.Real 3.Character 4.Void
  • 6. 1. Integer Data type Integer are used to store whole number Type Size(bytes) Range Format specifier int or signed int 2 -32,768 to +32767 %d Unsigned int 2 0 to 65535 %d long int or signed long int 4 -2,147,483 to +2,147,483,647 %d Unsigned long int 4 0 to 4,294,967,295 %lu
  • 7. 2. Real Data Type Floating types are used to store real numbers. Type Size(bytes) Range Format specifiers float 4 3.4X10 -38 to 3.4X10+38 %f double 8 1.7X10-308 to 1.7X10+308 %if long double 10 3.4X10-4932 to 3.4X10+4932 %Lf
  • 8. 3. Character Data Type Character types are used to store character value. Type Size(bytes) Range Format specifiers Char or signed char 1 -128 to 127 %c Unsigned char 1 0 to 255 %c
  • 9. 4. Void Data Type Void type means no value. This is usually used to specify the type of function which returns nothing by defining in front of main() or any other function and as blank arguments within functional backets. For example- 1. void main() 2.void main(void)
  • 10. B.Derived Data Type  Array: An array in c language is a collection of similar data-type,means an array can hold value of a particular data type for which it has been declared. Arrays can be created from any of the C data-types int.  Example: int a[4]={10,20,30,40}; Index/position a[0] a[1] a[2] a[3] Values Address in memory 1002 1004 1006  Pointer : C pointer is a special variable that can be used to store address of another variable. 10 20 30 40
  • 11. C. User Defined 1.Structure Data Type C structure is a collection of different data types which are grouped together and each element in a C structure is called member. Example: Struct student{ int roll no; char name[20]; char city[20]; } 2.Union Data Type  It is a package of variables of different types under a single name.  “union” keyword is used to define a structure.  The highest bytes of data types will occupy the memory. e.g. union student { int roll no; char name[10]; float per; }std; Structure student will occupy 4 bytes in memory as float is the highest data among int and char.
  • 12. 3. Enumerated Data Type (Enum)  Enumerated data type is a user defined data type having finite set of enumeration constant. The keyword “enum” is used to create enumerated data type. Enumeration data type consists of named integer constants as a list . It start with 0 (zero) by default and value is incremented by 1 for the sequential identifiers in the list. Syntax: Enum [data type] {const1,const2…constn} Enum example in C: enum month {Jan, Feb, Mar};or/* Jan,Feb and Mar variables will be assigned to 0,1 and 2 respectively by default */ enum month {Jan = 1, Feb, Mar};/*Feb and Mar variables will be assigned to 2 and 3 respectively by default */ Enum month {Jan = 20, Feb, Mar};/* Jan is assigned to 20. Feb and Mar variables will be assigned to 21 and 22 respectively by default */
  • 13. 4. Typedef Data Type It is used to create new data type. But it is commonly used to change existing data type with another name. Syntax: typedef [data_type]new_data_type; Example: typedef int integer; integer roll_no;
  • 14. THANK YOU FOR YOUR ATTENTION
  翻译: