How To Check Number Divisible By 5

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.
  1. <script>
  2. var given_Number = Number(prompt("Type your number to check if Divisible by 5 : "));
  3.  
  4. if(given_Number % 5 == 0)
  5. {
  6. document.write("<b style='color:blue; font-size:18px; font-family:cursive;'>The number <b style='color:red;'>"
  7. + given_Number + "</b> is divisible by <b style='color:red;'>5</b>. </b>");
  8. }
  9. else
  10. {
  11. document.write("<b style='color:blue; font-size:18px; font-family:cursive;'>The number <b style='color:red;'>"
  12. + given_Number + "</b> is not divisible by <b style='color:red;'>5</b>. </b>");
  13. }
  14. </script>

Output:

This is the result of the program in the given number that divisible by 5. Divisible by 5This is the result of the program in the given number that is not divisible by 5. 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.

Add new comment