From 12cafd708e3ce6f4888b84b296ede50350010247 Mon Sep 17 00:00:00 2001 From: jaybhatia55 <45117917+jaybhatia55@users.noreply.github.com> Date: Tue, 5 Oct 2021 22:49:54 +0530 Subject: [PATCH] Program to check if number is palindrome or not Program to check if number is palindrome or not --- FORKED_FOR_TSHIRT/Palindorm.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 FORKED_FOR_TSHIRT/Palindorm.cpp diff --git a/FORKED_FOR_TSHIRT/Palindorm.cpp b/FORKED_FOR_TSHIRT/Palindorm.cpp new file mode 100644 index 0000000..52a65ea --- /dev/null +++ b/FORKED_FOR_TSHIRT/Palindorm.cpp @@ -0,0 +1,20 @@ +#include +using namespace std; +int main() +{ + int n,r,sum=0,temp; + cout<<"Enter the Number="; + cin>>n; + temp=n; + while(n>0) +{ + r=n%10; + sum=(sum*10)+r; + n=n/10; +} +if(temp==sum) +cout<<"Number is Palindrome."; +else +cout<<"Number is not Palindrome."; + return 0; +} \ No newline at end of file