Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Class notes

DATA TYPES IN C

Rating
-
Sold
-
Pages
7
Uploaded on
31-12-2024
Written in
2024/2025

C LANGUAGE NOTES ON ANSHUMAN SHARMA BOOK LEARN PROGRAMMING IN C

Institution
Course

Content preview

Data Types in C

••
Each variable in C has an associated data type. It specifies the type of data that the
variable can store like integer, character, floating, double, etc. Each data type
requires different amounts of memory and has some specific operations which can
be performed over it. The data type is a collection of data with values having fixed
values, meaning as well as its characteristics.
The data types in C can be classified as follows:
Types Description

Primitive Data Primitive data types are the most basic data types that are used for
Types representing simple values such as integers, float, characters, etc.

User Defined
The user-defined data types are defined by the user himself.
Data Types

The data types that are derived from the primitive or built-in
Derived Types
datatypes are referred to as Derived Data Types.




Different data types also have different ranges up to which they can store numbers.
These ranges may vary from compiler to compiler. Below is a list of ranges along
with the memory requirement and format specifiers on the 32-bit GCC compiler.

, Size Format
Data Type (bytes) Range Specifier


short int 2 -32,768 to 32,767
%hd


unsigned short
2 0 to 65,535 %hu
int



unsigned int 4 0 to 4,294,967,295 %u



-2,147,483,648 to
int 4 %d
2,147,483,647



-2,147,483,648 to
long int 4 %ld
2,147,483,647



unsigned long
4 0 to 4,294,967,295 %lu
int



signed char 1 -128 to 127 %c


unsigned char 1 0 to 255 %c



float 4 %f
1.2E-38 to 3.4E+38


double 8 %lf
1.7E-308 to 1.7E+308

Written for

Institution
Course

Document information

Uploaded on
December 31, 2024
Number of pages
7
Written in
2024/2025
Type
Class notes
Professor(s)
Kanika jindal
Contains
Commerce 1st semester

Subjects

$26.89
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
Himanshugupta01

Get to know the seller

Seller avatar
Himanshugupta01 GUJRANWALA GURU NANAK INSTITUTE OF MANAGEMENT AND TECHNOLOGY
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
1 year
Number of followers
0
Documents
10
Last sold
-
PTU EDUCATOR

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions