SlideShare ist ein Scribd-Unternehmen logo
1 von 17
Prepared by:
Raj Naik
SY CE-1
150410107053
 Data type specifies the type of data stored in a variable.
 Data types in C programming language enables the
programmers to appropriately select the data as per
requirements of the program and the associated
operations of handling it.
 The data type can be classified into two types Primitive
data type and Non-Primitive data type
 The primitive data types are the basic data types that are
available in most of the programming languages.
 The primitive data types are used to represent single values.
 Primitive data are only single values, they have not special
capabilities.
 Data structure that normally are directly operated upon by
machine level instructions are known as primitive structure
and data type.
 Integer(int): This is used to represent a number
without decimal point.
Eg: 12, 90
 Float and Double: This is used to represent a number
with decimal point.
Eg: 45.1, 67.3
 Character : This is used to represent single character
Eg: ‘C’, ‘a’
 Syntax for integer:
int variable_name;
 Syntax for float:
float variable_name;
 Syntax for double:
double variable_name;
 Syntax for chracter:
char variable_name;
Datatype Size(in bytes) Range
Integer
int
signed int
unsigned int
short int
signed short int
unsigned short int
long int
signed long int
unsigned long int
2
2
2
1
1
1
4
4
4
-32,768 to 32,767
-32,768 to 32,767
0 to 65535
-128 to 127
-128 to 127
0 to 255
-2,147,483,648 to
2,147,483,647
Same as Above
0 to 4,294,967,295
Float &
Double
float
double
long double
4
8
10
3.4E-38 to 3.4E+38
1.7E-308 to 1.7E+308
3.4E-4932 to
1.1E+4932
Character
char
signed char
unsigned char
1
1
1
-128 to 127
-128 to 127
0 to 255
 The data types that are derived from primary data types are
known as non-Primitive data types.
 These data types are used to store group of values.
 The non-primitive data types are,
Arrays
Structure
Union
linked list
Stacks
Queue
 An array is used to store a collection of variables of the same
data type.
 A specific element in an array is accessed by an index.
 All arrays consist of contiguous memory locations.
 Syntax for declaring array is,
data type arrayName [ arraySize ];
 Initializing Arrays,
double balance[5] = {1000.0, 2.0, 3.4, 7.0, 50.0};
 The lowest address corresponds to the first element and the
highest address to the last element.
 Structure is another user defined data type available in C
that allows to combine data items of different kinds.
 Structures are used to represent a record.
 To define a structure, we must use the struct statement.
The struct statement defines a new data type, with more
than one member. The format of the struct statement is as
follows −
 struct [structure tag] { member definition; member
definition; ... member definition; } [one or more structure
variables];
 struct Books { char title[50]; char author[50]; char
subject[100]; int book_id; } book;
 A union is a special data type available in C that allows
to store different data types in the same memory
location. We can define a union with many members,
but only one member can contain a value at any given
time. Unions provide an efficient way of using the
same memory location for multiple-purpose.
 To define a union, we must use the union statement
 union [union tag] { member definition; member
definition; ... member definition; } [one or more union
variables];
 Here is the way that we could define a union type
named Data having three members i, f, and str −
 union Data { int i; float f; char str[20]; } data;
 The memory occupied by a union will be large enough
to hold the largest member of the union. For example,
in the above example, Data type will occupy 20 bytes of
memory space because this is the maximum space
which can be occupied by a character string.
 The linked list consists of series of structures. They are
not required to be stored in adjacent memory location.
Each structure consists of a data field and address
field. Address field contains the address of its
successors.
 The actual representation of the structure is as follow:
 A variable of the above structure type is conventionally
known as node.
 Here the representation of a linked list of three nodes:
Node A Node B Node C
Data Address
X1 X2 X3
 Node A stored data X1 and the address of the successor node B.
Node B stores the data X2 and the address of its successor node
C. node C contains the data X3 and its address field is grounded,
indicating it does not have successor.
 There are three types of Linked List:
 Singly Linked List
 Doubly Linked List
 Circular Linked List
 Linked lists are the best and simplest example of a dynamic data
structure that uses pointers for its implementation.
 Items can be added or removed from the middle of the list.
 There is no need to define an initial size.
 Stack can be implemented
using the Linked List or
Array.
 Stack is LIFO Structure [ Last
in First Out ]
 Stack is Ordered List
of Elements of Same Type.
 Stack is Linear List
 In Stack all Operations such
as Insertion and
Deletion are permitted at
only one end called Top
Position of Top Status of Stack
-1 Stack is Empty
0
First Element is
Just Added into
Stack
N-1
Stack is said to
Full
N
Stack is said to
be Overflow
 Queue is a specialized data storage structure (Abstract data
type).
 Arrays access of elements in a Queue is restricted.
 It has two main operations enqueue and dequeue.
 Insertion in a queue is done using enqueue function and
removal from a queue is done using dequeue function.
 An item can be inserted at the end of the queue and
removed from the front of the queue.
 It is therefore, also called First-In-First-Out (FIFO) list.
 Queue has important properties,
 capacity stands for the maximum number of elements Queue
can hold,
 size stands for the current size of the Queue,
 elements is the array of elements,
 It has two basic implementations,
 Array-based implementation – It’s simple and efficient but
the maximum size of the queue is fixed.
 Singly Linked List-based implementation – It’s complicated
but there is no limit
 on the queue size, it is subjected to the available memory.
Thank you…

Weitere ähnliche Inhalte

Was ist angesagt?

linked list in data structure
linked list in data structure linked list in data structure
linked list in data structure shameen khan
 
Types of Constructor in C++
Types of Constructor in C++Types of Constructor in C++
Types of Constructor in C++Bhavik Vashi
 
Interface in java ,multiple inheritance in java, interface implementation
Interface in java ,multiple inheritance in java, interface implementationInterface in java ,multiple inheritance in java, interface implementation
Interface in java ,multiple inheritance in java, interface implementationHoneyChintal
 
Operator Overloading
Operator OverloadingOperator Overloading
Operator OverloadingNilesh Dalvi
 
Union in C programming
Union in C programmingUnion in C programming
Union in C programmingKamal Acharya
 
Data members and member functions
Data members and member functionsData members and member functions
Data members and member functionsHarsh Patel
 
Dynamic memory allocation in c
Dynamic memory allocation in cDynamic memory allocation in c
Dynamic memory allocation in clavanya marichamy
 
Conditional operators
Conditional operatorsConditional operators
Conditional operatorsBU
 
Static Data Members and Member Functions
Static Data Members and Member FunctionsStatic Data Members and Member Functions
Static Data Members and Member FunctionsMOHIT AGARWAL
 
Introduction to data structure ppt
Introduction to data structure pptIntroduction to data structure ppt
Introduction to data structure pptNalinNishant3
 
Abstract data types (adt) intro to data structure part 2
Abstract data types (adt)   intro to data structure part 2Abstract data types (adt)   intro to data structure part 2
Abstract data types (adt) intro to data structure part 2Self-Employed
 

Was ist angesagt? (20)

linked list in data structure
linked list in data structure linked list in data structure
linked list in data structure
 
stack & queue
stack & queuestack & queue
stack & queue
 
Data types in c++
Data types in c++Data types in c++
Data types in c++
 
Programming in c Arrays
Programming in c ArraysProgramming in c Arrays
Programming in c Arrays
 
Types of Constructor in C++
Types of Constructor in C++Types of Constructor in C++
Types of Constructor in C++
 
Interface in java ,multiple inheritance in java, interface implementation
Interface in java ,multiple inheritance in java, interface implementationInterface in java ,multiple inheritance in java, interface implementation
Interface in java ,multiple inheritance in java, interface implementation
 
Operator Overloading
Operator OverloadingOperator Overloading
Operator Overloading
 
Union in C programming
Union in C programmingUnion in C programming
Union in C programming
 
Abstract Data Types
Abstract Data TypesAbstract Data Types
Abstract Data Types
 
Data members and member functions
Data members and member functionsData members and member functions
Data members and member functions
 
Dynamic memory allocation in c
Dynamic memory allocation in cDynamic memory allocation in c
Dynamic memory allocation in c
 
Conditional operators
Conditional operatorsConditional operators
Conditional operators
 
Static Data Members and Member Functions
Static Data Members and Member FunctionsStatic Data Members and Member Functions
Static Data Members and Member Functions
 
Linked List
Linked ListLinked List
Linked List
 
Introduction to data structure ppt
Introduction to data structure pptIntroduction to data structure ppt
Introduction to data structure ppt
 
Sorting
SortingSorting
Sorting
 
Abstract data types (adt) intro to data structure part 2
Abstract data types (adt)   intro to data structure part 2Abstract data types (adt)   intro to data structure part 2
Abstract data types (adt) intro to data structure part 2
 
Stack
StackStack
Stack
 
Aggregate function
Aggregate functionAggregate function
Aggregate function
 
This pointer
This pointerThis pointer
This pointer
 

Andere mochten auch

Difference between dtd and xsd
Difference between dtd and xsdDifference between dtd and xsd
Difference between dtd and xsdUmar Ali
 
Effective business communication
Effective business communicationEffective business communication
Effective business communicationSuzanne Hazelton
 
TCS Job Interview Questions
TCS Job Interview QuestionsTCS Job Interview Questions
TCS Job Interview QuestionsNavdeep Kumar
 
Uml Omg Fundamental Certification 2
Uml Omg Fundamental Certification 2Uml Omg Fundamental Certification 2
Uml Omg Fundamental Certification 2Ricardo Quintero
 
Difference Between Sql - MySql and Oracle
Difference Between Sql - MySql and OracleDifference Between Sql - MySql and Oracle
Difference Between Sql - MySql and OracleSteve Johnson
 
The Graph Traversal Programming Pattern
The Graph Traversal Programming PatternThe Graph Traversal Programming Pattern
The Graph Traversal Programming PatternMarko Rodriguez
 
Relational database management system (rdbms) i
Relational database management system (rdbms) iRelational database management system (rdbms) i
Relational database management system (rdbms) iRavinder Kamboj
 
Introduction of data structure
Introduction of data structureIntroduction of data structure
Introduction of data structureeShikshak
 
Lecture 1 data structures and algorithms
Lecture 1 data structures and algorithmsLecture 1 data structures and algorithms
Lecture 1 data structures and algorithmsAakash deep Singhal
 
Rdbms
RdbmsRdbms
Rdbmsrdbms
 
Voka kempen innovatieacademie 2015 session 6
Voka kempen innovatieacademie 2015 session 6Voka kempen innovatieacademie 2015 session 6
Voka kempen innovatieacademie 2015 session 6Frank Dethier
 

Andere mochten auch (20)

Array1
Array1Array1
Array1
 
HDF5 Abstract Data Model
HDF5 Abstract Data ModelHDF5 Abstract Data Model
HDF5 Abstract Data Model
 
Difference between dtd and xsd
Difference between dtd and xsdDifference between dtd and xsd
Difference between dtd and xsd
 
Effective business communication
Effective business communicationEffective business communication
Effective business communication
 
TCS Job Interview Questions
TCS Job Interview QuestionsTCS Job Interview Questions
TCS Job Interview Questions
 
Uml Omg Fundamental Certification 2
Uml Omg Fundamental Certification 2Uml Omg Fundamental Certification 2
Uml Omg Fundamental Certification 2
 
Difference Between Sql - MySql and Oracle
Difference Between Sql - MySql and OracleDifference Between Sql - MySql and Oracle
Difference Between Sql - MySql and Oracle
 
The Graph Traversal Programming Pattern
The Graph Traversal Programming PatternThe Graph Traversal Programming Pattern
The Graph Traversal Programming Pattern
 
Stack a Data Structure
Stack a Data StructureStack a Data Structure
Stack a Data Structure
 
Relational database management system (rdbms) i
Relational database management system (rdbms) iRelational database management system (rdbms) i
Relational database management system (rdbms) i
 
Introduction of data structure
Introduction of data structureIntroduction of data structure
Introduction of data structure
 
RDBMS.ppt
RDBMS.pptRDBMS.ppt
RDBMS.ppt
 
Data Structure
Data StructureData Structure
Data Structure
 
Lecture 1 data structures and algorithms
Lecture 1 data structures and algorithmsLecture 1 data structures and algorithms
Lecture 1 data structures and algorithms
 
Rdbms
RdbmsRdbms
Rdbms
 
Jorge informatica
Jorge informaticaJorge informatica
Jorge informatica
 
Skinput
SkinputSkinput
Skinput
 
Voka kempen innovatieacademie 2015 session 6
Voka kempen innovatieacademie 2015 session 6Voka kempen innovatieacademie 2015 session 6
Voka kempen innovatieacademie 2015 session 6
 
Artesanía ad 15
Artesanía ad 15Artesanía ad 15
Artesanía ad 15
 
Aplicasiones informaticas en la red
Aplicasiones informaticas en la redAplicasiones informaticas en la red
Aplicasiones informaticas en la red
 

Ähnlich wie Data Types - Premetive and Non Premetive

DATA STRUCTURES - SHORT NOTES
DATA STRUCTURES - SHORT NOTESDATA STRUCTURES - SHORT NOTES
DATA STRUCTURES - SHORT NOTESsuthi
 
Concept Of C++ Data Types
Concept Of C++ Data TypesConcept Of C++ Data Types
Concept Of C++ Data Typesk v
 
ARRAYS IN C++ CBSE AND STATE +2 COMPUTER SCIENCE
ARRAYS IN C++ CBSE AND STATE +2 COMPUTER SCIENCEARRAYS IN C++ CBSE AND STATE +2 COMPUTER SCIENCE
ARRAYS IN C++ CBSE AND STATE +2 COMPUTER SCIENCEVenugopalavarma Raja
 
DATA STRUCTURE AND ALGORITJM POWERPOINT.ppt
DATA STRUCTURE AND ALGORITJM POWERPOINT.pptDATA STRUCTURE AND ALGORITJM POWERPOINT.ppt
DATA STRUCTURE AND ALGORITJM POWERPOINT.pptyarotos643
 
2. Introduction to Data Structure.pdf
2. Introduction to Data Structure.pdf2. Introduction to Data Structure.pdf
2. Introduction to Data Structure.pdfSulabhPawaia
 
data structure programing language in c.ppt
data structure programing language in c.pptdata structure programing language in c.ppt
data structure programing language in c.pptLavkushGupta12
 
DATA STRUCTURE IN C LANGUAGE
DATA STRUCTURE IN C LANGUAGEDATA STRUCTURE IN C LANGUAGE
DATA STRUCTURE IN C LANGUAGEshubhamrohiwal6
 
8074.pdf
8074.pdf8074.pdf
8074.pdfBAna36
 
Data structures introduction
Data structures   introductionData structures   introduction
Data structures introductionmaamir farooq
 
Arrays in Data Structure and Algorithm
Arrays in Data Structure and Algorithm Arrays in Data Structure and Algorithm
Arrays in Data Structure and Algorithm KristinaBorooah
 
Datastructures and algorithms prepared by M.V.Brehmanada Reddy
Datastructures and algorithms prepared by M.V.Brehmanada ReddyDatastructures and algorithms prepared by M.V.Brehmanada Reddy
Datastructures and algorithms prepared by M.V.Brehmanada ReddyMalikireddy Bramhananda Reddy
 
Concept of c data types
Concept of c data typesConcept of c data types
Concept of c data typesManisha Keim
 
Data structures and algorithms short note (version 14).pd
Data structures and algorithms short note (version 14).pdData structures and algorithms short note (version 14).pd
Data structures and algorithms short note (version 14).pdNimmi Weeraddana
 
data structure details of types and .ppt
data structure details of types and .pptdata structure details of types and .ppt
data structure details of types and .pptpoonamsngr
 
Structures in c language
Structures in c languageStructures in c language
Structures in c languageTanmay Modi
 

Ähnlich wie Data Types - Premetive and Non Premetive (20)

DS_PPT.pptx
DS_PPT.pptxDS_PPT.pptx
DS_PPT.pptx
 
DS_PPT.ppt
DS_PPT.pptDS_PPT.ppt
DS_PPT.ppt
 
DATA STRUCTURES - SHORT NOTES
DATA STRUCTURES - SHORT NOTESDATA STRUCTURES - SHORT NOTES
DATA STRUCTURES - SHORT NOTES
 
Dsa unit 1
Dsa unit 1Dsa unit 1
Dsa unit 1
 
Concept Of C++ Data Types
Concept Of C++ Data TypesConcept Of C++ Data Types
Concept Of C++ Data Types
 
ARRAYS IN C++ CBSE AND STATE +2 COMPUTER SCIENCE
ARRAYS IN C++ CBSE AND STATE +2 COMPUTER SCIENCEARRAYS IN C++ CBSE AND STATE +2 COMPUTER SCIENCE
ARRAYS IN C++ CBSE AND STATE +2 COMPUTER SCIENCE
 
DATA STRUCTURE AND ALGORITJM POWERPOINT.ppt
DATA STRUCTURE AND ALGORITJM POWERPOINT.pptDATA STRUCTURE AND ALGORITJM POWERPOINT.ppt
DATA STRUCTURE AND ALGORITJM POWERPOINT.ppt
 
1597380885789.ppt
1597380885789.ppt1597380885789.ppt
1597380885789.ppt
 
2. Introduction to Data Structure.pdf
2. Introduction to Data Structure.pdf2. Introduction to Data Structure.pdf
2. Introduction to Data Structure.pdf
 
data structure programing language in c.ppt
data structure programing language in c.pptdata structure programing language in c.ppt
data structure programing language in c.ppt
 
DATA STRUCTURE IN C LANGUAGE
DATA STRUCTURE IN C LANGUAGEDATA STRUCTURE IN C LANGUAGE
DATA STRUCTURE IN C LANGUAGE
 
8074.pdf
8074.pdf8074.pdf
8074.pdf
 
Data structures introduction
Data structures   introductionData structures   introduction
Data structures introduction
 
Arrays in Data Structure and Algorithm
Arrays in Data Structure and Algorithm Arrays in Data Structure and Algorithm
Arrays in Data Structure and Algorithm
 
intr_ds.ppt
intr_ds.pptintr_ds.ppt
intr_ds.ppt
 
Datastructures and algorithms prepared by M.V.Brehmanada Reddy
Datastructures and algorithms prepared by M.V.Brehmanada ReddyDatastructures and algorithms prepared by M.V.Brehmanada Reddy
Datastructures and algorithms prepared by M.V.Brehmanada Reddy
 
Concept of c data types
Concept of c data typesConcept of c data types
Concept of c data types
 
Data structures and algorithms short note (version 14).pd
Data structures and algorithms short note (version 14).pdData structures and algorithms short note (version 14).pd
Data structures and algorithms short note (version 14).pd
 
data structure details of types and .ppt
data structure details of types and .pptdata structure details of types and .ppt
data structure details of types and .ppt
 
Structures in c language
Structures in c languageStructures in c language
Structures in c language
 

Kürzlich hochgeladen

Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...HyderabadDolls
 
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...gajnagarg
 
Computer science Sql cheat sheet.pdf.pdf
Computer science Sql cheat sheet.pdf.pdfComputer science Sql cheat sheet.pdf.pdf
Computer science Sql cheat sheet.pdf.pdfSayantanBiswas37
 
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...kumargunjan9515
 
Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...
Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...
Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...HyderabadDolls
 
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样wsppdmt
 
Charbagh + Female Escorts Service in Lucknow | Starting ₹,5K To @25k with A/C...
Charbagh + Female Escorts Service in Lucknow | Starting ₹,5K To @25k with A/C...Charbagh + Female Escorts Service in Lucknow | Starting ₹,5K To @25k with A/C...
Charbagh + Female Escorts Service in Lucknow | Starting ₹,5K To @25k with A/C...HyderabadDolls
 
Ranking and Scoring Exercises for Research
Ranking and Scoring Exercises for ResearchRanking and Scoring Exercises for Research
Ranking and Scoring Exercises for ResearchRajesh Mondal
 
Fun all Day Call Girls in Jaipur 9332606886 High Profile Call Girls You Ca...
Fun all Day Call Girls in Jaipur   9332606886  High Profile Call Girls You Ca...Fun all Day Call Girls in Jaipur   9332606886  High Profile Call Girls You Ca...
Fun all Day Call Girls in Jaipur 9332606886 High Profile Call Girls You Ca...kumargunjan9515
 
Kings of Saudi Arabia, information about them
Kings of Saudi Arabia, information about themKings of Saudi Arabia, information about them
Kings of Saudi Arabia, information about themeitharjee
 
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...nirzagarg
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Valters Lauzums
 
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...nirzagarg
 
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...gajnagarg
 
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...HyderabadDolls
 
RESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptx
RESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptxRESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptx
RESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptxronsairoathenadugay
 
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...nirzagarg
 
Gartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptxGartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptxchadhar227
 
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...nirzagarg
 
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...HyderabadDolls
 

Kürzlich hochgeladen (20)

Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
 
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
 
Computer science Sql cheat sheet.pdf.pdf
Computer science Sql cheat sheet.pdf.pdfComputer science Sql cheat sheet.pdf.pdf
Computer science Sql cheat sheet.pdf.pdf
 
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
 
Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...
Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...
Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...
 
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
 
Charbagh + Female Escorts Service in Lucknow | Starting ₹,5K To @25k with A/C...
Charbagh + Female Escorts Service in Lucknow | Starting ₹,5K To @25k with A/C...Charbagh + Female Escorts Service in Lucknow | Starting ₹,5K To @25k with A/C...
Charbagh + Female Escorts Service in Lucknow | Starting ₹,5K To @25k with A/C...
 
Ranking and Scoring Exercises for Research
Ranking and Scoring Exercises for ResearchRanking and Scoring Exercises for Research
Ranking and Scoring Exercises for Research
 
Fun all Day Call Girls in Jaipur 9332606886 High Profile Call Girls You Ca...
Fun all Day Call Girls in Jaipur   9332606886  High Profile Call Girls You Ca...Fun all Day Call Girls in Jaipur   9332606886  High Profile Call Girls You Ca...
Fun all Day Call Girls in Jaipur 9332606886 High Profile Call Girls You Ca...
 
Kings of Saudi Arabia, information about them
Kings of Saudi Arabia, information about themKings of Saudi Arabia, information about them
Kings of Saudi Arabia, information about them
 
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
 
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
 
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
 
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
 
RESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptx
RESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptxRESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptx
RESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptx
 
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
 
Gartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptxGartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptx
 
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
 
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
 

Data Types - Premetive and Non Premetive

  • 1. Prepared by: Raj Naik SY CE-1 150410107053
  • 2.  Data type specifies the type of data stored in a variable.  Data types in C programming language enables the programmers to appropriately select the data as per requirements of the program and the associated operations of handling it.  The data type can be classified into two types Primitive data type and Non-Primitive data type
  • 3.  The primitive data types are the basic data types that are available in most of the programming languages.  The primitive data types are used to represent single values.  Primitive data are only single values, they have not special capabilities.  Data structure that normally are directly operated upon by machine level instructions are known as primitive structure and data type.
  • 4.  Integer(int): This is used to represent a number without decimal point. Eg: 12, 90  Float and Double: This is used to represent a number with decimal point. Eg: 45.1, 67.3  Character : This is used to represent single character Eg: ‘C’, ‘a’
  • 5.  Syntax for integer: int variable_name;  Syntax for float: float variable_name;  Syntax for double: double variable_name;  Syntax for chracter: char variable_name;
  • 6. Datatype Size(in bytes) Range Integer int signed int unsigned int short int signed short int unsigned short int long int signed long int unsigned long int 2 2 2 1 1 1 4 4 4 -32,768 to 32,767 -32,768 to 32,767 0 to 65535 -128 to 127 -128 to 127 0 to 255 -2,147,483,648 to 2,147,483,647 Same as Above 0 to 4,294,967,295 Float & Double float double long double 4 8 10 3.4E-38 to 3.4E+38 1.7E-308 to 1.7E+308 3.4E-4932 to 1.1E+4932 Character char signed char unsigned char 1 1 1 -128 to 127 -128 to 127 0 to 255
  • 7.  The data types that are derived from primary data types are known as non-Primitive data types.  These data types are used to store group of values.  The non-primitive data types are, Arrays Structure Union linked list Stacks Queue
  • 8.  An array is used to store a collection of variables of the same data type.  A specific element in an array is accessed by an index.  All arrays consist of contiguous memory locations.  Syntax for declaring array is, data type arrayName [ arraySize ];  Initializing Arrays, double balance[5] = {1000.0, 2.0, 3.4, 7.0, 50.0};  The lowest address corresponds to the first element and the highest address to the last element.
  • 9.  Structure is another user defined data type available in C that allows to combine data items of different kinds.  Structures are used to represent a record.  To define a structure, we must use the struct statement. The struct statement defines a new data type, with more than one member. The format of the struct statement is as follows −  struct [structure tag] { member definition; member definition; ... member definition; } [one or more structure variables];  struct Books { char title[50]; char author[50]; char subject[100]; int book_id; } book;
  • 10.  A union is a special data type available in C that allows to store different data types in the same memory location. We can define a union with many members, but only one member can contain a value at any given time. Unions provide an efficient way of using the same memory location for multiple-purpose.  To define a union, we must use the union statement  union [union tag] { member definition; member definition; ... member definition; } [one or more union variables];
  • 11.  Here is the way that we could define a union type named Data having three members i, f, and str −  union Data { int i; float f; char str[20]; } data;  The memory occupied by a union will be large enough to hold the largest member of the union. For example, in the above example, Data type will occupy 20 bytes of memory space because this is the maximum space which can be occupied by a character string.
  • 12.  The linked list consists of series of structures. They are not required to be stored in adjacent memory location. Each structure consists of a data field and address field. Address field contains the address of its successors.  The actual representation of the structure is as follow:  A variable of the above structure type is conventionally known as node.  Here the representation of a linked list of three nodes: Node A Node B Node C Data Address X1 X2 X3
  • 13.  Node A stored data X1 and the address of the successor node B. Node B stores the data X2 and the address of its successor node C. node C contains the data X3 and its address field is grounded, indicating it does not have successor.  There are three types of Linked List:  Singly Linked List  Doubly Linked List  Circular Linked List  Linked lists are the best and simplest example of a dynamic data structure that uses pointers for its implementation.  Items can be added or removed from the middle of the list.  There is no need to define an initial size.
  • 14.  Stack can be implemented using the Linked List or Array.  Stack is LIFO Structure [ Last in First Out ]  Stack is Ordered List of Elements of Same Type.  Stack is Linear List  In Stack all Operations such as Insertion and Deletion are permitted at only one end called Top Position of Top Status of Stack -1 Stack is Empty 0 First Element is Just Added into Stack N-1 Stack is said to Full N Stack is said to be Overflow
  • 15.  Queue is a specialized data storage structure (Abstract data type).  Arrays access of elements in a Queue is restricted.  It has two main operations enqueue and dequeue.  Insertion in a queue is done using enqueue function and removal from a queue is done using dequeue function.  An item can be inserted at the end of the queue and removed from the front of the queue.  It is therefore, also called First-In-First-Out (FIFO) list.
  • 16.  Queue has important properties,  capacity stands for the maximum number of elements Queue can hold,  size stands for the current size of the Queue,  elements is the array of elements,  It has two basic implementations,  Array-based implementation – It’s simple and efficient but the maximum size of the queue is fixed.  Singly Linked List-based implementation – It’s complicated but there is no limit  on the queue size, it is subjected to the available memory.