Data Types in C
PRESENTED BY MINAKSHI SHARMA
�In C programming, data types specify the type of data a variable can hold. They specify the size, memory allocation, and operations that can be performed on variables. �
Categories of Data Types in C
1. Basic Data Types:- Used to store fundamental types of data such as integers, floating-point numbers, and characters.
2. Derived Data Types:- Derived from basic data types.
3. Enumeration Data Types:- Used to define a set of named integer constants.
4. User-Defined Data Types:- Created by the programmer for specific needs.
Integers:-Used for whole numbers.�(Non decimal values)
Integers types
Float types:-
Char types:-
Strings
In C, strings are represented as arrays of characters ending with a null terminator '\0'.
This null terminator indicates the end of the string in memory.
Declaration and Initialization of Strings
char str1[20] = "Hello, World!";
Key Points About Strings
Booleans in C�
C does not have a dedicated boolean type in its standard you can use integers (0 for false and any non-zero value for true) to represent boolean values.
#include <stdio.h> #include <stdbool.h> int main()
{
bool isTrue = true;
bool isFalse = false;