# Checking whether a number is divisible by a given number

**URL:** <https://cl.desmos.com/t/checking-whether-a-number-is-divisible-by-a-given-number/2981>\
**Category:** Questions\
**Tags:** dashboard, validation, correctness\
**Created:** [March 23, 2021, 6:01pm UTC](https://cl.desmos.com/t/checking-whether-a-number-is-divisible-by-a-given-number/2981 "2021-03-23T18:01:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jessica\_Seekamp](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jessica_seekamp/32/2462_2.png) [@Jessica\_Seekamp](https://cl.desmos.com/u/Jessica_Seekamp)\
**Post date:** [March 23, 2021, 6:01pm UTC](https://cl.desmos.com/t/checking-whether-a-number-is-divisible-by-a-given-number/2981/1 "2021-03-23T18:01:26Z")

</div>

Hi! I’m trying to ask the students to input a number that is divisible by both 25 and 8, and I want it marked correct or incorrect on the teacher dashboard.

I was thinking I could check to see whether the input is on the line y = 200x, where x is an integer, but I’m not sure how to make that happen in CL.

Thanks!

---

<div class="post-metadata">

**Author:** ![Daniel\_Grubbs](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/daniel_grubbs/32/719_2.png) [@Daniel\_Grubbs](https://cl.desmos.com/u/Daniel_Grubbs)\
**Post date:** [March 23, 2021, 6:31pm UTC](https://cl.desmos.com/t/checking-whether-a-number-is-divisible-by-a-given-number/2981/2 "2021-03-23T18:31:52Z")

</div>

You could use modular math here:

```auto
check= numericValue(`\mod(${input.numericValue},200)`)=0
correct: check

```

---

<div class="post-metadata">

**Author:** ![Jessica\_Seekamp](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jessica_seekamp/32/2462_2.png) [@Jessica\_Seekamp](https://cl.desmos.com/u/Jessica_Seekamp)\
**Post date:** [March 23, 2021, 7:03pm UTC](https://cl.desmos.com/t/checking-whether-a-number-is-divisible-by-a-given-number/2981/3 "2021-03-23T19:03:24Z")

</div>

That worked! Thanks so much.

---

<div class="post-metadata">

**Author:** ![Daniel\_Grubbs](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/daniel_grubbs/32/719_2.png) [@Daniel\_Grubbs](https://cl.desmos.com/u/Daniel_Grubbs)\
**Post date:** [March 23, 2021, 7:05pm UTC](https://cl.desmos.com/t/checking-whether-a-number-is-divisible-by-a-given-number/2981/4 "2021-03-23T19:05:20Z")

</div>

You’re welcome. You could also use a variable for the 200 if you wanted to change up your divisors:

```auto
a=25
b=8
d=numericValue(`\lcm(${a},${b})`)
check= numericValue(`\mod(${input.numericValue},${d})`)=0
correct: check

```
