Learn C Language from the Best Tutors
Search in
Data types are used to define the type of data that a variable can store.
1. Int: whole numbers , Format String: %d , Size: 4byte
2. float: decimal numbers , Format String: %f , Size: 4byte
3. double: double-precision floating-point numbers , Format String: %lf , Size: 8byte
4. Char: store a single character. Format String: %c, Size: 1byte , mention in single quotes.
5. long int: larger integer values than int. Format String: %ld, Size:4 or 8 byte.
6. long long int: very large integer values. Format String: %lld, Size: 8byte
read lessC programming language supports several data types, which are categorized into two main groups: primitive or basic data types and derived data types.
Primitive data types include:
Integers: Represent whole numbers and can be signed or unsigned. Common integer types are int
(usually 32 bits), short
(16 bits), and long
(typically 32 or 64 bits).
Floating-point: Represent real numbers with a decimal point. Common types are float
(single precision) and double
(double precision).
Character: Used for storing individual characters. The char
type is typically 8 bits.
Void: Represents the absence of a type. It is often used as the return type for functions that do not return a value.
Derived data types are created by combining the primitive data types. Examples include:
Arrays: Collections of elements of the same data type, accessed using an index.
Structures: Allow grouping variables of different data types under a single name.
Pointers: Variables that store memory addresses, enabling dynamic memory allocation and manipulation.
Union: Similar to structures but share the same memory space for different members.
Enumerations: User-defined data types consisting of named integer constants.
Understanding these data types and their usage is essential for effective C programming, as they provide the building blocks for constructing various data structures and algorithms.
read lessC programming language supports various data types, each designed to hold different types of values. The primary data types in C include:
int: Used for integers, it typically represents whole numbers and has a size of 4 bytes on most systems.
float: Used for floating-point numbers (real numbers), it is a 4-byte data type for representing single-precision floating-point values.
double: Similar to float but with double precision, a double data type is used for storing larger floating-point numbers. It is usually 8 bytes in size.
char: Stands for character, and it is used to store a single character. It occupies 1 byte of memory.
_Bool: Represents Boolean values, which can be either true or false. It has a size of 1 byte.
short: A 2-byte integer data type, it is used when memory conservation is crucial, but the range of values is within the limit.
long: Used to store large integers, it is typically 4 bytes on 32-bit systems and 8 bytes on 64-bit systems.
long long: An extended version of the long data type, introduced in the C99 standard, typically 8 bytes in size, providing a larger range for integers.
In C programming, common data types include:
int: Integer type, typically representing whole numbers.
float: Floating-point type, used for decimal numbers.
double: Double-precision floating-point type, for more precision than float.
char: Character type, for storing single characters.
_Bool: Boolean type, representing true or false values.
short: Short integer type, typically smaller than int.
long: Long integer type, for larger range than int.
long long: Extended size integer type for even larger range.
Modifiers like signed and unsigned can be applied to some types, altering their range and behavior. It's important to consider the specific system and compiler, as the sizes of these data types can vary.
read lessView 4 more Answers
Related Questions
Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com
Ask a QuestionRecommended Articles
Brilliant Academy, a reputed B. Tech Tuition...
Brilliant Academy is one of the reputed institutes for B.Tech tuition classes. This institute is specialised in delivering quality tuition classes for B.E, Engineering - all streams and Engineering diploma courses. Incorporated in 2012, Brillant Academy is a brainchild of Mr Jagadeesh. The main motto of the academy is to...
Lasya Infotech: An educational Training...
Lasya Infotech is a Hyderabad based IT training institute founded in 2016 by O Venkat. Believing in his innovation, passion and persistence and with a diverse blend of experience, he started his brainchild to deliver exemplary professional courses to aspiring candidates by honing their skills. Ever since the institute envisions...
Top 5 Skills Every Software Developer Must have
Software Development has been one of the most popular career trends since years. The reason behind this is the fact that software are being used almost everywhere today. In all of our lives, from the morning’s alarm clock to the coffee maker, car, mobile phone, computer, ATM and in almost everything we use in our daily...
8 Hottest IT Careers of 2014!
Whether it was the Internet Era of 90s or the Big Data Era of today, Information Technology (IT) has given birth to several lucrative career options for many. Though there will not be a “significant" increase in demand for IT professionals in 2014 as compared to 2013, a “steady” demand for IT professionals is rest assured...
Looking for C Language Classes?
Learn from the Best Tutors on UrbanPro
Are you a Tutor or Training Institute?
Join UrbanPro Today to find students near youThe best tutors for C Language Classes are on UrbanPro
The best Tutors for C Language Classes are on UrbanPro