SHARE
TWEET

Untitled

a guest Jun 24th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function checkNumber(number,oddNumber,evenNumber) {
  2.     if(Math.abs(oddNumber % 2) === 0){
  3.         alert("YOUR NUMBER IS NOT ODD");
  4.     }
  5.     // checking if the number is even because % is modulo and var % 2 will r
  6.     if(Math.abs(evenNumber % 2) > 0){
  7.         alert("YOUR NUMBER IS NOT EVEN");
  8.     }
  9.      if ((Math.abs(number % evenNumber)) === 0) {
  10.         console.log("even");
  11.     }
  12.     if((Math.abs(number % oddNumber)) === 0){
  13.         console.log("odd");
  14.     }
  15.     if(((Math.abs(number % evenNumber) === 0)) && (((Math.abs(number % oddNumber)) === 0)){
  16.         console.log("even the odds");
  17.     }
  18. checkNumber();
  19. }
  20.  
  21.  
  22.  
  23. function isPrimeNumber (){
  24. var primes=0;
  25. var isprime = true;
  26. for (var counter = 2; counter <= 100; counter = counter + 1)
  27. {
  28.     isprime = true;
  29.     var limit = Math.round(Math.sqrt(counter));
  30.     for (var mod = 2; mod <= limit; mod++) {
  31.                if (counter%mod == 0) {
  32.             isprime = false;
  33.             break;
  34.         }
  35.     }
  36.  
  37. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top