SHARE
TWEET

Untitled

a guest May 23rd, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function Palindrom(int) {
  2.   var rem, temp, final = 0;
  3.   var number = 120;
  4.  
  5.   temp = number;
  6.   while (number > 0) {
  7.     rem = number % 10;
  8.     number = parseInt(number / 10);
  9.     final = final * 10 + rem;
  10.   }
  11.  
  12.   if (final == temp) {
  13.     return "Palindrom";
  14.   } else {
  15.     return "Bukan Palindrom";
  16.   }
  17. }
  18. console.log(Palindrom());
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