We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4e805b9 commit dafb1a0Copy full SHA for dafb1a0
1 file changed
Programs/DSA/palin.js
@@ -0,0 +1,29 @@
1
+/*
2
+12. WAP in Js Function Check Pallindrome
3
+ Number
4
+
5
+ Input - 121
6
+ Output -Pallindrome
7
8
+*/
9
10
11
+function checkpalindrome(num) {
12
13
+ let s = 0, r, n
14
+ n = num
15
+ while (num > 0) {
16
17
+ r = num % 10
18
+ s = s * 10 + r
19
+ num = Math.floor(num / 10);
20
+ }
21
+ if (s == n) {
22
+ console.log("The number is Pallindrome = ", s)
23
+ } else {
24
+ console.log("The number is not Pallindrome ", s)
25
26
+}
27
28
+checkpalindrome(121)
29
+checkpalindrome(236)
0 commit comments