VOOZH about

URL: https://www.geeksforgeeks.org/c/int-1-sign-bit-31-data-bits-keyword-in-c/

⇱ int keyword in C - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

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.

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.


Output
10 20 30

Size of int

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


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
Article Tags:
Article Tags: