SlideShare a Scribd company logo
4
Most read
5
Most read
6
Most read
By Ansh Kashyap
DATA TYPES IN C
BCA 1 semester
Section B
In the C Programming language, data types refer to a broad 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.
DATA TYPES
TYPES OF DATA TYPES
DATA TYPES
Primary Derived
Int Char
Float Type Void
User Define
Enumerated Typedef
Structure
Array Pointer
Integers are whole numbers with a range of values, range of values are machine
dependant. Generally an integer occupies 2 bytes memory space and its value range
limited to -32768 to +32767.
INT DATA TYPES
Data Type ControlString Size Range
Int %d 2 bytes -32768 to 32767
Long int %ld 4 bytes -2 to +2
Unsigned int %u 2 bytes 0 to 65535
31 31
Character type variable can hold a single character. As there are signed and
unsigned int (either short or long), in the same way there are signed and unsigned
chars; both occupy 1 byte each, but having different ranges Unsigned characters
have values between 0 and 255; signed character have from -128 to 127.
CHAR DATA TYPE
The float data type is used to store fractional numbers (real numbers) with 6 digits of
precision. Floating point number is insufficient, we can use the double to define the
number. The double is same as float but with longer precision and takes double
space (8 bytes) than float. To extend the precision further we can use long double
which occupies 10 bytes of memory space.
FLOAT DATA TYPE
Data Type Size Value Range Precision
float 4 byte 1.2E-38 to
3.4E+38
6 Decimal places
double 8 byte 2.3E-308 to
1.7E+308
15 Decimal places
Long double 10 byte 3.4E-4932 to
1.1E+4932
19 Decimal places
The void data types 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. Like in our first C program we declared “main()” as void type because
it does not return any value.
TYPE VOID 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-type int.
DERIVED DATA TYPE
Pointer: C Pointer is a special variable that can be used to store address of another
variable.
Enumerated data type is a user defined data type having finite set of enumeration
constants. 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.
ENUMERATED DATA
TYPE (ENUM)
Syntax:
Enum [data_type] {const1,const2…….constn};
Enum examples 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 */
It is used to create new data type. But it is commonly used to change existing data
type with another name.
TYPEDEF DATA TYPE
Syntax:
typedef [data_type] new_data_type;
Example:
Typedef int integer;
Integer roll_no;
C Structure is a collection of different data types which are grouped together and
each element in a C structure is called member.
TYPEDEF DATA TYPE
Example:
struct student {
Int roll_no;
char name[20];
char city[20];
}
THANK YOU

More Related Content

PPTX
Data types in C
PPTX
PPT ON NUMBER SYSTEM
PPTX
Two dimensional arrays
PPTX
PDF
ไฟฟ้ากระแส
DOCX
Project report on Ligth sensitive trigger
PPT
Biomass
PDF
Power System Analysis!
Data types in C
PPT ON NUMBER SYSTEM
Two dimensional arrays
ไฟฟ้ากระแส
Project report on Ligth sensitive trigger
Biomass
Power System Analysis!

What's hot (20)

PPTX
data types in C programming
PPT
Variables in C Programming
PPTX
Pointers in c++
PPTX
Tokens in C++
PPTX
C functions
PPT
constants, variables and datatypes in C
PPT
Data structures using c
PPTX
Pointers in c language
PPTX
Variables in C and C++ Language
PPT
C++ data types
PPTX
File in C language
PDF
C Pointers
PPTX
Values and Data types in python
PPT
structure and union
PPTX
Data types
PPTX
Dynamic memory allocation in c
PPT
Pointers C programming
PPTX
Data Types In C
PPTX
Functions in c++
PPTX
Structure in C
data types in C programming
Variables in C Programming
Pointers in c++
Tokens in C++
C functions
constants, variables and datatypes in C
Data structures using c
Pointers in c language
Variables in C and C++ Language
C++ data types
File in C language
C Pointers
Values and Data types in python
structure and union
Data types
Dynamic memory allocation in c
Pointers C programming
Data Types In C
Functions in c++
Structure in C
Ad

Similar to Data types in C (20)

PPTX
datatypes and specifiers_and variables.pptx
PPTX
Datatypes in c
PPTX
data types in c programming language in detail
PPTX
Data types
PDF
cassignmentii-170424105623.pdf
 
PPTX
Data Types | CS8251- Programming in c | Learn Hub
PDF
Constants Variables Datatypes by Mrs. Sowmya Jyothi
PPTX
Variables in C++, data types in c++
PDF
variablesfinal-170820055428 data type results
PPTX
Programming Fundamentals lecture 6
PPT
Data Handling
PPT
Datatypes
PPTX
Concept of c data types
PPTX
C PROGRAMMING LANGUAGE
PPTX
Data types
DOCX
UNIT-II VISUAL BASIC.NET | BCA
PPT
Enumerated data types in C
PPTX
Concept Of C++ Data Types
 
PPTX
Data types in C language
PPTX
Module 1:Introduction
datatypes and specifiers_and variables.pptx
Datatypes in c
data types in c programming language in detail
Data types
cassignmentii-170424105623.pdf
 
Data Types | CS8251- Programming in c | Learn Hub
Constants Variables Datatypes by Mrs. Sowmya Jyothi
Variables in C++, data types in c++
variablesfinal-170820055428 data type results
Programming Fundamentals lecture 6
Data Handling
Datatypes
Concept of c data types
C PROGRAMMING LANGUAGE
Data types
UNIT-II VISUAL BASIC.NET | BCA
Enumerated data types in C
Concept Of C++ Data Types
 
Data types in C language
Module 1:Introduction
Ad

Recently uploaded (20)

DOCX
How to Use SharePoint as an ISO-Compliant Document Management System
PDF
EaseUS PDF Editor Pro 6.2.0.2 Crack with License Key 2025
PPTX
Monitoring Stack: Grafana, Loki & Promtail
PDF
AI/ML Infra Meetup | Beyond S3's Basics: Architecting for AI-Native Data Access
PDF
Website Design Services for Small Businesses.pdf
PPTX
Patient Appointment Booking in Odoo with online payment
PDF
How Tridens DevSecOps Ensures Compliance, Security, and Agility
PPTX
Tech Workshop Escape Room Tech Workshop
PDF
Autodesk AutoCAD Crack Free Download 2025
PDF
Top 10 Software Development Trends to Watch in 2025 🚀.pdf
 
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
DNT Brochure 2025 – ISV Solutions @ D365
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
DuckDuckGo Private Browser Premium APK for Android Crack Latest 2025
PPTX
assetexplorer- product-overview - presentation
PDF
Complete Guide to Website Development in Malaysia for SMEs
PPTX
Why Generative AI is the Future of Content, Code & Creativity?
PPTX
Oracle Fusion HCM Cloud Demo for Beginners
PPTX
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
PDF
AI/ML Infra Meetup | LLM Agents and Implementation Challenges
How to Use SharePoint as an ISO-Compliant Document Management System
EaseUS PDF Editor Pro 6.2.0.2 Crack with License Key 2025
Monitoring Stack: Grafana, Loki & Promtail
AI/ML Infra Meetup | Beyond S3's Basics: Architecting for AI-Native Data Access
Website Design Services for Small Businesses.pdf
Patient Appointment Booking in Odoo with online payment
How Tridens DevSecOps Ensures Compliance, Security, and Agility
Tech Workshop Escape Room Tech Workshop
Autodesk AutoCAD Crack Free Download 2025
Top 10 Software Development Trends to Watch in 2025 🚀.pdf
 
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
DNT Brochure 2025 – ISV Solutions @ D365
wealthsignaloriginal-com-DS-text-... (1).pdf
DuckDuckGo Private Browser Premium APK for Android Crack Latest 2025
assetexplorer- product-overview - presentation
Complete Guide to Website Development in Malaysia for SMEs
Why Generative AI is the Future of Content, Code & Creativity?
Oracle Fusion HCM Cloud Demo for Beginners
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
AI/ML Infra Meetup | LLM Agents and Implementation Challenges

Data types in C

  • 1. By Ansh Kashyap DATA TYPES IN C BCA 1 semester Section B
  • 2. In the C Programming language, data types refer to a broad 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. DATA TYPES
  • 3. TYPES OF DATA TYPES DATA TYPES Primary Derived Int Char Float Type Void User Define Enumerated Typedef Structure Array Pointer
  • 4. Integers are whole numbers with a range of values, range of values are machine dependant. Generally an integer occupies 2 bytes memory space and its value range limited to -32768 to +32767. INT DATA TYPES Data Type ControlString Size Range Int %d 2 bytes -32768 to 32767 Long int %ld 4 bytes -2 to +2 Unsigned int %u 2 bytes 0 to 65535 31 31
  • 5. Character type variable can hold a single character. As there are signed and unsigned int (either short or long), in the same way there are signed and unsigned chars; both occupy 1 byte each, but having different ranges Unsigned characters have values between 0 and 255; signed character have from -128 to 127. CHAR DATA TYPE
  • 6. The float data type is used to store fractional numbers (real numbers) with 6 digits of precision. Floating point number is insufficient, we can use the double to define the number. The double is same as float but with longer precision and takes double space (8 bytes) than float. To extend the precision further we can use long double which occupies 10 bytes of memory space. FLOAT DATA TYPE Data Type Size Value Range Precision float 4 byte 1.2E-38 to 3.4E+38 6 Decimal places double 8 byte 2.3E-308 to 1.7E+308 15 Decimal places Long double 10 byte 3.4E-4932 to 1.1E+4932 19 Decimal places
  • 7. The void data types 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. Like in our first C program we declared “main()” as void type because it does not return any value. TYPE VOID DATA TYPE
  • 8. 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-type int. DERIVED DATA TYPE Pointer: C Pointer is a special variable that can be used to store address of another variable.
  • 9. Enumerated data type is a user defined data type having finite set of enumeration constants. 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. ENUMERATED DATA TYPE (ENUM) Syntax: Enum [data_type] {const1,const2…….constn}; Enum examples 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 */
  • 10. It is used to create new data type. But it is commonly used to change existing data type with another name. TYPEDEF DATA TYPE Syntax: typedef [data_type] new_data_type; Example: Typedef int integer; Integer roll_no;
  • 11. C Structure is a collection of different data types which are grouped together and each element in a C structure is called member. TYPEDEF DATA TYPE Example: struct student { Int roll_no; char name[20]; char city[20]; }