diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..0cba2e6 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "files.associations": { + "iostream": "cpp" + } +} \ No newline at end of file diff --git a/Programming/C++/Palindrome_Number/Palindromenumber.cpp b/Programming/C++/Palindrome_Number/Palindromenumber.cpp new file mode 100644 index 0000000..d13d3e4 --- /dev/null +++ b/Programming/C++/Palindrome_Number/Palindromenumber.cpp @@ -0,0 +1,36 @@ +#include + +using namespace std; + +int main() +{ + +int x, rev = 0, rem, ori; + cout<<"Enter an integer: "; + cin>>x; + + ori=x; + while (x != 0) + { + rem = x % 10; + rev = rev * 10 + rem; + x /= 10; + } + +if (ori>0) +{ + + if(ori==rev) + cout<<"True"; + else + cout<<"False"; +} +else +{ + cout<<"False"; + +} + return 0; + + +} \ No newline at end of file