Basic Data Types in C Understanding fundamental data types
Introduction C provides several standard data types to represent numbers, characters, etc. They form the foundation for all programs.
Primary Data Types int - Integer numbers (e.g., 5, -20) char - Single character (e.g., 'A', 'z') float - Single precision floating point numbers double - Double precision floating point numbers void - Represents no value
Examples of Primary Data Types int age = 25; char grade = 'A'; float pi = 3.14f; double bigPi = 3.1415926535; void functionName(); // returns nothing
Type Modifiers short, long, signed, unsigned can modify basic types Examples: short int, long int, unsigned int, long double
Summary Basic types are building blocks of C programs. Choosing the right type ensures efficient memory usage and correctness.