C program to check palindrome without using string functions

C program to check palindrome without using string functions

This page has a C program to check palindrome without using string functions. Palindrome string contains a set of Characters (string).  If the reverse of a given set of Characters is equal to the originally given set of Characters (string), then the given set of Characters is called Palindrome. Example for Palindrome String: malayalam. The below given C program is used to check whether given string is palindrome or not without using string functions. Kindly check out the program to check whether a given string is palindrome or not without using string functions. The questions to check a string is palindrome or not can be asked like,

1). C program to check given string is palindrome or not
2). C Program to check if a given string is Palindrome
3). C Program to check a string is Palindrome without using string functions

4). Check Palindrome in C without using string functions
5). C Program to check whether entered string is Palindrome or not

6). C program to check a given string is palindrome or not


Check Palindrome without using string function:

   #include <stdio.h>
   #include <string.h>
   int main(){
                 char string_given[100], reverse_string[100] = {'\0'};
                 int a, set_flag = 1, string_len = 0;
                 printf("\n Enter a string : ");
                 gets(string_given);
                 for (a = 0; string_given[a] != '\0'; a++)
                {
                 string_len++;
                 }
                 printf("\n The length of the given string '%s' is %d\n", string_given, string_len);
                 for (a = string_len-1; a >= 0 ; a--)
                {
                 reverse_string[string_len-a-1] = string_given[a];
                 }
                 for (a = 0; a < string_len ; a++)
                {
                if (reverse_string[a] != string_given[a])
                set_flag = 0;
                }
                if (set_flag == 1)
                printf ("\n\n The given string '%s' is palindrome", string_given);
                else
                printf("\n\n The given string '%s' is not palindrome", string_given);
                getch();
   return(0);
   }



Sample Outputs:

Enter a string: Malayalam

The given string Malayalam is a palindrome

 

Enter a string: Tamil

The given string Tamil is not a palindrome


Related Popular Posts:

Other Related C Programs :


* C Program to find whether the given number is Odd or Even

* C Program to find the Sum of Odd Digits

* C Program to find the Sum of Even Digits

* C Program to find the Sum of Even and Odd Digits,

* C Program to Display Odd digits

* C Program to Display even digits

* C Program to Display Odd Numbers,

* C Program to Display Even Numbers,

* C Program to Check whether the given number is Armstrong number

* C Program to display the Armstrong numbers in Range

* C Program to display the Armstrong numbers between 1 and 1000

* C Program to check perfect number, perfect numbers in range

* C Program to Check Prime number, Prime numbers between 1 and 100

* C Program to display the Prime numbers in a Range

* C Program to display the Sum of Prime numbers

* C Program to Check Strong number

* C Program to display the Strong number in Range

* C Program to Check whether the given number is polindrome number or not

* C Program to Check polindrome number using for loop

* C Program to Check polindrome number using Recursion

* C Program to  check whether the given string is polindrome or not

* C Program to find the Roots of Quadratic equation

* C Program to display Fibonacci Series

* C Program to display the Fibonacci Series using an array

* C Program to display the Fibonacci Series using while loop

* C Program to find the Sum of Fibonacci Series, Factorial of Number

* C Program to find the Factorial without using Recursion

* C Program to find the Factorial using Pointers

* C Program to find the Factorial using Function

Bookmark and Share