# Need some help with math

**URL:** https://forum.makecode.com/t/need-some-help-with-math/31663
**Category:** Help
**Created:** [November 12, 2024, 9:42pm UTC](https://forum.makecode.com/t/need-some-help-with-math/31663 "2024-11-12T21:42:07Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Brainstorm\_Studios](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/brainstorm_studios/32/20476_2.png) [@Brainstorm\_Studios](https://forum.makecode.com/u/Brainstorm_Studios)
#### Post date: [November 12, 2024, 9:42pm UTC](https://forum.makecode.com/t/need-some-help-with-math/31663/1 "2024-11-12T21:42:07Z")

</div>

how do i let my code know to check for whether a number is even or odd?

---

<div class="post-metadata">

### Author: ![Taser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/taser/32/29517_2.png) [@Taser](https://forum.makecode.com/u/Taser)
#### Post date: [November 12, 2024, 11:53pm UTC](https://forum.makecode.com/t/need-some-help-with-math/31663/2 "2024-11-12T23:53:20Z")

</div>

mb something like this?

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/3/1/310327b992e57bc92092d9022a78fffc2a1b75e5.png)

if the remainder you get when you divide a number by 2 is 1, then it is odd. (3/2 has a remainder of 1)  
if the remainder you getwhen you divide a number by 2 is 0, then it is even. (4/2 has no remainder)

---

<div class="post-metadata">

### Author: ![Don](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/don/32/17989_2.png) [@Don](https://forum.makecode.com/u/Don)
#### Post date: [November 13, 2024, 2:52pm UTC](https://forum.makecode.com/t/need-some-help-with-math/31663/3 "2024-11-13T14:52:59Z")

</div>

The best way I know of is to use the remainder of / block. It implements something called modulo arithmetic. Think about it and experiment till you figure out how to use it.
