• We just launched and are currently in beta. Join us as we build and grow the community.

How To Check Number Divisible By 5

Tecz

Virtual Store Owner
T Rep
0
0
0
Rep
0
T Vouches
0
0
0
Vouches
0
Posts
71
Likes
90
Bits
2 MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1 300 XP
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. if

    (

    given_Number %

    5

    ==

    0

    )
  4. {
  5. document.write

    (

    "<b style='color:blue; font-size:18px; font-family:cursive;'>The number <b style='color:red;'>"
  6. +

    given_Number +

    "</b> is divisible by <b style='color:red;'>5</b>. </b>"

    )

    ;
  7. }
  8. else
  9. {
  10. document.write

    (

    "<b style='color:blue; font-size:18px; font-family:cursive;'>The number <b style='color:red;'>"
  11. +

    given_Number +

    "</b> is not divisible by <b style='color:red;'>5</b>. </b>"

    )

    ;
  12. }
  13. </

    script>

Output:

This is the result of the program in the given number that divisible by 5.
2_23.png

This is the result of the program in the given number that is not divisible by 5.
3_3.png


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.


Download
You must upgrade your account or reply in the thread to view hidden text.
 

452,292

323,348

323,357

Top