Last active
May 5, 2022 11:46
-
-
Save rvbsanjose/10813768 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Using the JavaScript language, have the function PrimeTime(num) take the num parameter being passed and return the string | |
// true if the parameter is a prime number, otherwise return the string false. The range will be between 1 and 2^16. | |
// Input = 19 Output = true | |
// Input = 110 Output = false | |
function PrimeTime( num ) { | |
for ( var i = 2; i < num; i++ ) { | |
if ( num % i == 0 ) | |
return false; | |
} | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment