How To Check Number Divisible By 5
Submitted by alpha_luna on Wednesday, May 4, 2016 - 15:36.
In this tutorial, we are going to create on How To Check Number Divisible By 5. This program will run that will ask the user to enter their desired numeric value then the program will check if the given value is divisible in 5 or not. And we are using JavaScript for our Programming Language. This is a simple program that suited for the beginner in JavaScript.
JavaScript
This script will check the given number if it is divisible by 5 or not.
This is the result of the program in the given number that is not divisible by 5.
So what can you say about this work? Share your thoughts in the comment section below or email me at [email protected]. Practice Coding. Thank you very much.
- <script>
- var given_Number = Number(prompt("Type your number to check if Divisible by 5 : "));
- if(given_Number % 5 == 0)
- {
- document.write("<b style='color:blue; font-size:18px; font-family:cursive;'>The number <b style='color:red;'>"
- + given_Number + "</b> is divisible by <b style='color:red;'>5</b>. </b>");
- }
- else
- {
- document.write("<b style='color:blue; font-size:18px; font-family:cursive;'>The number <b style='color:red;'>"
- + given_Number + "</b> is not divisible by <b style='color:red;'>5</b>. </b>");
- }
- </script>
Output:
This is the result of the program in the given number that divisible by 5.

Add new comment
- 617 views