Variables store typed values that later expressions can reuse.

Variables

variables.c
#include <stdio.h>

int main(void) {
    int unitPrice = ;
    int quantity = 3;
    int total = unitPrice * quantity;

    printf("unit=%d\n", unitPrice);
    printf("total=%d\n", total);
    return 0;
}
#include <stdio.h>

int main(void) {
    int unitPrice = ;
    int quantity = 3;
    int total = unitPrice * quantity;

    printf("unit=%d\n", unitPrice);
    printf("total=%d\n", total);
    return 0;
}
#include <stdio.h>

int main(void) {
    int unitPrice = ;
    int quantity = 3;
    int total = unitPrice * quantity;

    printf("unit=%d\n", unitPrice);
    printf("total=%d\n", total);
    return 0;
}
type Each C variable has a type such as `int` or `double`.
assignment An assignment stores a new value in an existing variable.