
Coding Education
What Is an Integer?

Hafiz Rahman
Lead Coding Instructor at Algonova Malaysia

An integer is a whole-number data type — a number with no decimal point and no fractional part, such as -4, 0, 7 or 300. In programming, an integer (often shortened to int) can be positive, negative or zero, but it never carries anything after a decimal point. The number 8 is an integer; 8.5 is not.
Table of Contents
Integer vs Other Data Types
Every value in a program has a data type that tells the computer how to store and use it. An integer holds whole numbers (10), a float holds numbers with decimals (3.14), and a string holds text ("Aisyah"). Picking the right type matters: you count lives in a game with an integer, but measure temperature with a float.
In Scratch, when a child sets a score variable to 0 and clicks change score by 1, the score climbs 1, 2, 3 — always whole numbers, so it behaves like an integer. In Python, lives = 3 stores the integer 3, while price = 2.50 stores a float. A concrete fact: most languages give integers their own type because whole-number maths is faster and exact, with no rounding errors.
Why It Matters for Kids
Integers are one of the first data types children meet, and telling them apart from decimals and text is a core idea in KSSR computing and wider STEM learning. Understanding types early helps kids avoid bugs and write clearer code in Algonova coding classes. Integers are usually stored inside a variable, so the two ideas go hand in hand.
Int and Integer in Coding
In coding, int is simply the short name for an integer, so "what is an int" and "what is an integer" ask the same thing. An integer number is any whole number with no decimal point, like 5, 0, or -20. Programmers reach for an integer when they need to count something exactly, such as lives, points, or the number of players.
Curious to see it in action? Book a free trial class and watch your child code with their first numbers.
