check is number is palindrome in C

#include <stdio.h>
#include <conio.h>

void main()
{

    int n,i,r=0;
    
    printf("Enter a number: ");
    scanf("%d",&n);
    
    for(i=n;i!=0;i)
    {
        r=r*10;
        r=r+ i%10;
        i=i/10;
    }
    
    if(r==n)
        printf("palindrome");
    else
        printf("Not palindrome");
}

3
1
Awgiedawgie 440215 points

                                    #include &lt;stdio.h&gt;
int main() {
    int n, reversedN = 0, remainder, originalN;
    printf(&quot;Enter an integer: &quot;);
    scanf(&quot;%d&quot;, &amp;n);
    originalN = n;

    // reversed integer is stored in reversedN
    while (n != 0) {
        remainder = n % 10;
        reversedN = reversedN * 10 + remainder;
        n /= 10;
    }

    // palindrome if orignalN and reversedN are equal
    if (originalN == reversedN)
        printf(&quot;%d is a palindrome.&quot;, originalN);
    else
        printf(&quot;%d is not a palindrome.&quot;, originalN);

    return 0;
}

3 (1 Votes)
0
0
0
Awgiedawgie 440215 points

                                    #include &lt;stdio.h&gt;
#include &lt;conio.h&gt;

int palindrome (int num);

void main()
{
    int n, ret;
    printf(&quot;Enter the number: &quot;);
    scanf(&quot;%d&quot;,&amp;n);

    ret = palindrome(n);

    if (ret == n)
        printf(&quot;\nPalindrome\n&quot;);
    else
        printf(&quot;\nNot Palindrome\n&quot;);
}

int palindrome(int num)
{
    int rem, rev=0;

    while (num!=0)
    {
        rem = num % 10;
        rev = rev * 10 + rem;
        num /= 10;
    }

    return rev;
}

0
0
4.1
10
Krish 100200 points

                                    // this is for string

#include &lt;stdio.h&gt;
#include &lt;string.h&gt;

void main()
{
  char a[100], b[100];

  printf(&quot;Enter a string to check if it's a palindrome: &quot;);
  gets(a);

  strcpy(b, a);

  if (strcmp(a, b) == 0)
    printf(&quot;\nThe string is palindrome.\n&quot;);

  else
    printf(&quot;\nThe string is not palindrome.\n&quot;);

  getch();
}

4.1 (10 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
how to find if string is a palindrome in c using pointer palindrome checker in c palindrome check function in c c program for palindrome string check palindrome string in c palindrome series program in c string palindrome in c using function program to find the palindrome of a number in c the given number is palindrome or not palindrome c palindrome string logic in c how to make a palindrome program in c using pointer Write a C program to check whether a 10 given string is a palindrome or not. how to check the string is palindrome in c check if a string is palindrome c c program for palindrome using function palindrome program in c without using string functions palindrome check in c is palindrome check program in c palindrome integer in c how to find palindromes in code C c program to check palindrome codechef solution c program to check palindrome codechef c program to check palindrome Write a C program to enter any number and check whether the number is palindrome or not. palindrome check using stack in c palindrome c program c program for palindrome number palindrome code in c Write a program in C to check whether a number is a palindrome or not. palindeom code in c palindrome string in c program check string is palindrome or not in c c check if palindrome string using inbuilt function c palindrome using function c program for palindrome using arrays palindrome using user defined function in c palidrome in c palindrom number in c programming how to check whether a string is a palindrome or not in c palindrome of string in c algorithm WAP to check user entered number is palindrome or not in c palindrome in c with string Write a C program to check whether a string is palindrome. string palindrome using stack in c highest value palindrome in c CHECKING PALINDROME(NUMBER) in c program palindrome of a string in c how to check palindrome in c string palindrome in c using strrev c program to find given string is palindrome or not c program to check whether a given string is palindrome or not Write a program in C to check whether the given string is a palindrome or not c program to check a string is palindrome or not c program to find palindrome sequence of palindrome numbers in c c palindrome program FIND WHETHER GIVEN string is palindroem or not in C code in c to find given array is palindrome or not find a number is palindrome or not in c check a string is palindrome or not in c paliindrome function in c c check if palindrome palindrome character program in c how to find palindrome number in c how to check if a word is palindrome or not in c palindrome using strrev in c program in c to check if a number is palindrome or not program to accept string in c and check palindrome check for a palindrome string in c palindrome in string in c program to check if a string is palindrome or not in c how to palindrome char in c program for string palindrome in c program for palindrome in c string palindrome program in c using for loop c program to check palindrome or not fonction palindrome en c string palindrome i n c palindrome i n c palindrome string in c Check whether the given string is a palindrome or not. in c check is number is palindrome in C check if string is palindrome in c palindrome in c using function programm to recognise palindrome number in c program to find given number is palindrome or not in c palindrome function C program for palindrome number in c how to find a palindrome number in c algorithm for palindrome number in c palindrom eprogram in c check palindrome number in c c program to check palindrome using array check for palindrome in c c program for palindrome WAP to find whether the number is a palindrome number. IN C how to check if string is palindrome in c palindrom in c string is palindrome in c palindrome in c using stack palindrome program in c using function palindrome string of numbers in c palindrome string of number in c palindeome number in c palindrom number using c string palindrome c palindrome c palindrome language c C Program to Check if a Given String is Palindrome or no c program to check palindrome number explain palindrome program in c create palindrome in c language how to write palindrome program fuction call command line program in c check for palindrome string in c palindrome in c code algorithme palindrome en c Write a C program to check if a user given number is a palindrome or not. c code for palindrome check for string palindrome in c c program to print palindrome or not string is palindrome or not in c find palindrome using in c palindrome or not in c palindrome program in c briefly explanation logic of palindrome program in c explanation c program to check palindrome string palindrome string in c palindrome program in c using strings palindrome program in c for string palindrome c program using for string c program to arrange in palindrome check palindrome in c C Program to Check Whether a Number is Palindrome or Not c program palindrome IS NUMBER PALINDROM C check whether the given number is a palindrome in c numner palindrome in c string palindrome in c palindrome number in c number palindrome in c code to find palindrome string in c c program to check whether the string is palindrome or not c program to check if string is palindrome palindrome of a string program in c palindrome in c palindrome test c palindrome string program in c palindrome program in c palindrome number program in c palindrome in c string how to check the given number is palindrome or not in c Write a C program to check whether a number is palindrome or not string palindrome program in c
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source