{"id":42,"date":"2021-10-31T14:57:00","date_gmt":"2021-10-31T14:57:00","guid":{"rendered":"https:\/\/rijankc.com.np\/2021\/10\/31\/wap-to-check-whether-the-given-number-is-palindrome\/"},"modified":"2024-11-04T09:29:55","modified_gmt":"2024-11-04T03:44:55","slug":"wap-to-check-whether-the-given-number-is-palindrome","status":"publish","type":"post","link":"https:\/\/rijankc.com.np\/?p=42","title":{"rendered":"WAP to check whether the given number is Palindrome."},"content":{"rendered":"<p><b>Question<br \/>\n<\/b><\/p>\n<div style=\"text-indent: 0px;\"><b><span style=\"font-family: 'Times New Roman', 'serif'; text-indent: -0.25in;\">Write a program to check whether the given number is palindrome.<\/span><\/b><\/div>\n<p style=\"line-height: normal; text-indent: -.25in; margin: 0in 0in 0in .25in;\"><span style=\"font-family: 'Times New Roman','serif'; mso-bidi-font-size: 11.0pt;\"><b>Ans:<\/b><\/span><\/p>\n<p style=\"line-height: normal; text-indent: -.25in; margin: 0in 0in 0in .25in;\"><span style=\"font-family: 'Times New Roman','serif'; mso-bidi-font-size: 11.0pt;\"><span style=\"mso-tab-count: 1;\">\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span>INPUT &#8220;Enter the Number &#8221; ; NUM<\/span><\/p>\n<p style=\"line-height: normal; text-indent: -.25in; margin: 0in 0in 0in .25in;\"><span style=\"font-family: 'Times New Roman','serif'; mso-bidi-font-size: 11.0pt;\"><span style=\"mso-tab-count: 1;\">\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span>N = NUM<\/span><\/p>\n<p style=\"line-height: normal; text-indent: -.25in; margin: 0in 0in 0in .25in;\"><span style=\"font-family: 'Times New Roman','serif'; mso-bidi-font-size: 11.0pt;\"><span style=\"mso-tab-count: 1;\">\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span>DO <span style=\"mso-tab-count: 1;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><\/span><\/p>\n<p style=\"line-height: normal; text-indent: -.25in; margin: 0in 0in 0in .25in;\"><span style=\"font-family: 'Times New Roman','serif'; mso-bidi-font-size: 11.0pt;\"><span style=\"mso-tab-count: 1;\">\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span>DIGIT = NUM MOD 10<\/span><\/p>\n<p style=\"line-height: normal; text-indent: -.25in; margin: 0in 0in 0in .25in;\"><span style=\"font-family: 'Times New Roman','serif'; mso-bidi-font-size: 11.0pt;\"><span style=\"mso-tab-count: 1;\">\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span>REVERSE = REVERSE * 10 + DIGIT<\/span><\/p>\n<p style=\"line-height: normal; text-indent: -.25in; margin: 0in 0in 0in .25in;\"><span style=\"font-family: 'Times New Roman','serif'; mso-bidi-font-size: 11.0pt;\"><span style=\"mso-tab-count: 1;\">\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span>NUM = NUM 10<\/span><\/p>\n<p style=\"line-height: normal; text-indent: -.25in; margin: 0in 0in 0in .25in;\"><span style=\"font-family: 'Times New Roman','serif'; mso-bidi-font-size: 11.0pt;\"><span style=\"mso-tab-count: 1;\">\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span>LOOP WHILE NUM &lt; &gt; 0<\/span><\/p>\n<p style=\"line-height: normal; text-indent: -.25in; margin: 0in 0in 0in .25in;\"><span style=\"font-family: 'Times New Roman','serif'; mso-bidi-font-size: 11.0pt;\"><span style=\"mso-tab-count: 1;\">\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span>IF N = REVERSE THEN PRINT N;<br \/>\n&#8220;palindrome&#8221; ELSE PRINT N; &#8220;not palindrome<\/span><\/p>\n<p style=\"line-height: normal; margin: 0in 0in 0in .25in;\"><span style=\"font-family: 'Times New Roman','serif'; mso-bidi-font-size: 11.0pt;\">END<\/span><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Question Write a program to check whether the given number is palindrome. Ans: \u00a0\u00a0\u00a0\u00a0\u00a0 INPUT &#8220;Enter the Number &#8221; ; NUM \u00a0\u00a0\u00a0\u00a0\u00a0 N = NUM \u00a0\u00a0\u00a0\u00a0\u00a0 DO \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0 DIGIT = NUM MOD 10 \u00a0\u00a0\u00a0\u00a0\u00a0 REVERSE = REVERSE * 10 + DIGIT \u00a0\u00a0\u00a0\u00a0\u00a0 NUM = NUM 10 \u00a0\u00a0\u00a0\u00a0\u00a0 LOOP WHILE NUM &lt; &gt; 0 \u00a0\u00a0\u00a0\u00a0\u00a0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":734,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[115,114],"tags":[],"class_list":["post-42","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-c-programming","category-wap"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/rijankc.com.np\/index.php?rest_route=\/wp\/v2\/posts\/42","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rijankc.com.np\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rijankc.com.np\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rijankc.com.np\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rijankc.com.np\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=42"}],"version-history":[{"count":2,"href":"https:\/\/rijankc.com.np\/index.php?rest_route=\/wp\/v2\/posts\/42\/revisions"}],"predecessor-version":[{"id":412,"href":"https:\/\/rijankc.com.np\/index.php?rest_route=\/wp\/v2\/posts\/42\/revisions\/412"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/rijankc.com.np\/index.php?rest_route=\/wp\/v2\/media\/734"}],"wp:attachment":[{"href":"https:\/\/rijankc.com.np\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=42"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rijankc.com.np\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=42"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rijankc.com.np\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=42"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}