Ends in 7 days

BLACK FRIDAY: Receive 83% off Programiz PRO

+🎁 Buy 1 year, gift 1 year FREE — Split with a friend for just $49.50 each

Start FREE trial →
Background Image

Buy 1 year, Gift 1 year —completely FREE

Start FREE trial →
Abdul Haq Mohammed
PRO
last year
Abdulcountry asked

Why do we use int data type?

Kelish Rai
Expert
last year
Kelish Rai answered

We use the int data type in C to store whole numbers, like 5, -2, or 1000.

In most programs, numbers come up a lot—whether it’s counting things, doing math, tracking scores, or working with menus and options—so having a way to store and work with integers is really useful.

Also, when you're just starting out, working with integers is simpler than other types like strings.

Let me know if there's anything else I can help with.

C
This question was asked as part of the Learn C Programming course.