0d: 00h: 00m: 00s

🎁 Get 3 extra months of learning — completely FREE

That's 90 extra days to master new skills, build more projects, and land your dream job.

Become a PRO
Background Image

🎁 Get 3 extra months of learning completely FREE

Become a PRO
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.