int keyword in C

Last Updated : 11 Jun, 2026

The int keyword in C is used to declare integer variables that store whole numbers without decimal values. It is one of the most commonly used data types in C programming.

  • int stands for integer.
  • It is used to store positive, negative, and zero values.
  • Most modern systems allocate 4 bytes of memory for an int.
C
#include <stdio.h>

int main(){
    int age = 25;

    printf("Age = %d", age);

    return 0;
}

Output
Age = 25

Explanation:

In the above example:

  • int age = 25; declares an integer variable named age.
  • The value 25 is stored in the variable.
  • %d is used in printf() to display an integer value.

Syntax

int variable_name;

Multiple int Variables

We can declare multiple integer variables in a single statement.

C
#include <stdio.h>

int main(){
    
    int a = 10, b = 20, c = 30;

    printf("%d %d %d", a, b, c);

    return 0;
}

Output
10 20 30

Size of int

The sizeof() operator can be used to determine the memory occupied by an integer variable.

C
#include <stdio.h>

int main(){
    
    printf("Size of int = %zu bytes", sizeof(int));

    return 0;
}

Output
Size of int = 4 bytes

Note: The size of int may vary depending on the compiler and system architecture, although it is typically 4 bytes on modern systems.

Range of int

A signed integer generally stores values in the following range:

TypeTypical SizeRange
int4 Bytes-2,147,483,648 to 2,147,483,647

Advantages of Using int

  • Efficient for storing whole numbers.
  • Faster arithmetic operations compared to floating-point types.
  • Widely supported across all C compilers.
  • Requires less memory than larger integer types such as long long.
Comment