Is Palindrome

    0

    0

    Giovanny Gongora

    Codiga's C++ Recipes

    Check if the particular number is Palindrome or not

    #include <stdio.h>
    #include <iostream>
    
    using namespace std;
    int isPalindrome(){
      int num,r,sum=0,temp;
      cout << "Enter a number: ";
      cin >> num;
      for(temp=num;num!=0;num=num/10){
        r=num%10;
        sum=sum*10+r;
      }
      if(temp==sum)
        cout << temp << " is a palindrome";
      else
        cout << temp << " is not a palindrome";
      return 0;
    }
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Explore
    • Cookbooks
    • Playground
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.