CHAPTER 05 / 26

C Data Types

Understand the main C data types such as int, float, char and double.

01 — Syntax

int, char, float, double, void

02 — Example

#include <stdio.h>

int main() {
    int a = 10;
    float price = 12.5;
    char grade = 'A';

    printf("%d %.1f %c", a, price, grade);
    return 0;
}

03 — Important Points

04 — Common Mistakes

05 — Real-World Use

Data types are important in embedded systems, numerical programs and memory-conscious software.

06 — Practice

Create a small program that demonstrates the main idea of C Data Types.

▶ Try It Yourself← PreviousNext →All Chapters