Write a program in swift to check the number is palindrome or not.

      Code:

import UIKit

var reversen = 0
var rem = 0
var n = 142
var no = n
no=n

while n != 0 {
    rem = n%10
    reversen = reversen * 10 + rem
    n /= 10
}
if(no == reversen)
{
    print("\(no)" + " is pelindrome")
}
else
{
    print("\(no)" + " is  not pelindrome")
   
}

Result:




1 comments:

  1. Slots machines, video poker - DrmCAD
    At SlotsMcd, you'll find 안양 출장안마 all the exciting and exciting slot 속초 출장안마 machines and slot 사천 출장샵 machine games to play, hand-picked by 경상남도 출장안마 the software developer. 광주 출장샵

    ReplyDelete