palindrome string program 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.7
10

                                    #include &lt;stdio.h&gt;
#include &lt;string.h&gt;
int main()
{

     char str[80];
     int length;
     printf(&quot;\nEnter a string to check if it's a palindrome: &quot;);
     scanf(&quot;%s&quot;, str);     // string input
     length = strlen(str); // finding the string length
     int i, j, count;
     for (i = 0, j = length - 1, count = 0; i &lt; length; i++, j--)
     {
          // matching string first character with the string last character
          if (str[i] == str[j])
          {
               count++; // if character match, increasing count by one.
          }
     }
     if (count == length) // if count == length, then the string is a palindrome.
     {
          printf(&quot;'%s' is a palindrome.\n&quot;, str);
     }
     else // otherwise the string is not a palindrome.
     {
          printf(&quot;'%s' is not a palindrome.\n&quot;, str);
     }
     return 0;
}

3.7 (10 Votes)
0
3.78
9
NiteCyper 95 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();
}

3.78 (9 Votes)
0
3
1
Marshall 105 points

                                    #include &lt;stdio.h&gt;#include &lt;string.h&gt; int main(){   char text[100];   int begin, middle, end, length = 0;    gets(text);    while ( text[length] != '\0' )      length++;    end = length - 1;   middle = length/2;    for( begin = 0 ; begin &lt; middle ; begin++ )   {      if ( text[begin] != text[end] )      {         printf(&quot;Not a palindrome.\n&quot;);         break;      }      end--;   }   if( begin == middle )      printf(&quot;Palindrome.\n&quot;);    return 0;}&nbsp;

3 (1 Votes)
0
4.33
10
Chuppa Chump 140 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;
}

4.33 (12 Votes)
0
4
4
ValentEEna 120 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;
}

4 (4 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 palindrome program in c without using string functions check if a string is palindrome c c program for palindrome using function palindrome check in c by reversing string\ 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 generating a string of size n made by character a b c that is not palindromic 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 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 palindrome in c without string function 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 find palindromic words in string in c find palindromic substring in string in c c program to check palindrome using array check for palindrome in c C program to print palindrome words in a string C Program to check if a string is a Palindrome without using built in function. c program for palindrome WAP to find whether the number is a palindrome number. IN C Write a C program to check whether a string is palindrome or not. output and code of Write program for string is palindrome or not palindrom in c string is palindrome in c string palindrome program in c using pointers 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 Write a program in C to check whether a user given number is Palindrome or Not. C Program to Check if a Given String is Palindrome or no c program to check palindrome number explain palindrome program in c how to check if string is a palindrome 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 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 program in c using strings palindrome program in c for string palindrome c program using for string c program to arrange in palindrome 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 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 Accept string from user and check whether the string is palindrome or not without considering its case in C palindrome program in c palindrome number program in c 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 check whether string is palindrome or not using c strrev() check whether string is palindrome or not using c how to check if a string is palindrome in c usi c program to determine whether a string is palindrome c program to check if a given string is palindrome or not c program to check if a given string is palindrome or nor Write a Program in c to findout a string is a palindrome or not check if a string is a palindrome c check palindrome in c string c program to check number is palindrome or not Write a c program to check if the given input string is palindrome or not, if palindrome then reverse it. write a c program to test if a string is a palindrome or not using a stack data structure Write a program to check whether a string is palindrome or not using stack in C c program to check palindrome without using string functions palindrome program in string in c string is palindrome or not in c manual palindrome in c string palindrome of string in c n number of string palindrome in c palindrome string c program input string is palindrome or not in c without string functions input string is palindrome or not in c write a program to check whether a number is palindrome or not in c Write a program to check if a number is palindrome or not. c (Use Loop). palindrome for string in c write a c program to check an array of string is palindrome or not how to find string is palindrome or not in c loop palindrome stirng c palindrome string in c how to chekc for palindrome with a string in c checking for palindrome string in c c program to check string is palindrome or not using stack palindrom of a string in c find wheter a string is palindrome or not in c check palindrome sub string in c string palindrome program in c c program to check whether a string is palindrome or not using stack palindrome of string c procedure to find string palindrome using stack in c WRITE A PROGRAM IN C TO ACCEPT AND CHECK A PALINDROME STRING. c palindrome program string check if a string is palindrome in c how to check if string is palindrome in c write code to check a string is palindrome or not in c c program to check if the string is palindrome or not using stack c string is palindrome what is string in palindrome in c c program to check string is palindrome or not Someone enters a string and check whether is it palindrome or not,which logic is used in c Write a C program to check if the user inputed string is palindrome or not using recursion 3. Write a c program to check palindrome number palindrome string program in c without library function palindrome string program in c check palindrome in c palindrome of a string in c palindrome in c string string palindrome in c write a program to check if the string is palindrome in c check for a palindrome in a string in c c program for palindrom string palindrome without using string function in c c program to check if a given string is palindrome
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