How to write a C Program To Find The Length, Reverse Of A String And To Check It Is Palindrome or Not in C Programming Language ?
Solution For C Program :
/*C Program To Find The Length, Reverse Of A String And To Check It Is Palindrome or Not.*/
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
int i,length=0,flag;
char str[10],rev[10];
clrscr();
printf("Enter the string==>");
scanf("%s",str);
for(i=0;str[i]!='\0';i++)
{
length++;
}
printf("\nLength of %s is ==>%d\n",str,length);
length--;
for(i=0;length>=0;i++)
{
rev[i]=str[length];
length--;
}
rev[i]='\0';
printf("\nReverse of %s is ==>%s\n",str,rev);
length++;
for(i=0;rev[i]!='\0';i++)
{
length++;
}
printf("\nLength of %s is ==>%d\n",rev,length);
for(i=0;str[i]!='\0'||rev[i]!='\0';i++)
{
if(str[i]!=rev[i])
{
flag=1;
break;
}
}
if(flag==1)
printf("\nString is not polyndrom");
else
printf("\nString is polyndrom");
getch();
}
Learn More :
String
- Write a c program to check given string is palindrome number or not.
- C Program to Convert Text String to Binary
- C Program String - Alphabet Count Example
- C Program String Example
- C Program String Count Example
- C Program String Example
- C Program to Print a String Without Use Semicolon.
- C Program To Find Length Of A String Including Blank Spaces, Tabs, And Other Special Characters
- C Program To Find Length Of String And Concatenate Two Strings
- C Program To Print String In Formatted Output Form
- C Program To Reverse The String Using Pointer
- C Program Concatenating Two Strings Into A Third System
- C Program Date from string DDDD-DD-DD
- BUILDS A STRING FROM THE LSB BITS OF EACH PIXEL
- C Program Finds Sub-String Search in String
- C Program to concatenate two strings without using string functions
- C Program to Count Vowels, Consonants and Spaces in a string
- C Program to convert a string to upper case
- C Program Performs a search and replace for a specified target and replacement string
- C Program Anagrams
- C Program to find string length without library function
- C Program to Check Given String is Palindrome or Not
- C Program to Converts a Number to a String.
- Design a C function that shortens a string to 8 characters
Check
- CHECKING LEAP YEAR USING C PROGRAM.
- Check given number is prime number or not using c program.
- Write a c program to check given string is palindrome number or not.
- C program to Check While packet(s) hasn't been acked
- C Program to Check Prime Use Loop And Recursive
- Given a numerical value, check if at least one of the elements of the vector is equal to the numerical value if so, say where in the negative case, say that there is no.
- C Program To Check The Given Value Is Vowel
- C Function to Check Vowel
- C Program To Check Leap Year
- C Program To Check If It Is A Palindrome Numbers Or Not
- C Program to Check if a number is in an array[1000]
- Armstrong Number Checker in C
- C Program to Check Given String is Palindrome or Not
- C Program to Check Whether Number Is Perfect Or Not
- C Program To Alarm Check
- C Program To Read A Parenthesised Infix Expression From The User And Check Whether It Is Well Parenthesised Or Not
- Input a Number and Check if it's Palindrome or not C Program
- Input Number and Check if it's Armstrong C Program
- Input Number and Check if it's Even or Odd C Program
Find
- Find out the perfect number using c program
- Find g.c.d of two number using c program.
- Write a c program to find out NCR factor of given number
- How to Write a C program to find maximum between two numbers ?
- Write a C program to find maximum between three numbers ?
- C or C++ program to read marks of 4 subjects and find how many students are pass and fail with division
- C Program turnLEDOn to Drives Forward Until It Finds The Line
- Write overloaded function templates for finding the roots of the linear (a * x + b = 0) and square (a * x2 + b * x + c = 0) uravneniy.Zamechanie: in function to send coefficients of the equations.
- C Program to Find Random Number
- C Program To Find LCM and HCF Of Two Number Using Function - 2
- C Program to find LCM and HCF Of Two Number Using Recursion - 3
- C Program To Find LCM and HCF Of Two Number -1
- C Program To Find Length Of A String Including Blank Spaces, Tabs, And Other Special Characters
- C Program To Find Length Of String And Concatenate Two Strings
- C Program To Find Product Of Two No Using MACRO
- C Program To Find Reverse Of Any Digit Number
- C Program To Find Sum and Difference Of Two Matrices
- C Program To Find The Frequency Of A Number
- C Program To Find The Maximum And Minimum Value In An Array
- C Program To Find Transpose Of A Matrix
- C Program To Find Union & Intersection Of Two Array
- C Program Finding the sum of Squares using Recursion
- C Program to Find NCR Of A Given Number Program
- C Program To Find Maximum Of Given Numbers
Reverse
- C Program to Reverse a Word
- C Program Array Example: Reverse
- C Program To Find Reverse Of Any Digit Number
- C Program To Reverse A Number
- C Program To Reverse The String Using Pointer
- C Program To Sort An Array Of Names In Alphabetical And Reverse Order
- C Program To Reverse A Given Number
- C Program To Reverse A Number
- C Program to Reversing a Five Digit Integer Number
- C program to reverse an array elements using Dynamic Memory Allocation
- C Program to accept n numbers from user store these numbers into an array & reverse an array elements using function
- Creation and Display of Elements in Both Forward and Reverse Direction in a Doubly Linked List
- Input Number and Print it's Reverse C Program
Length
- C Program To Find Length Of A String Including Blank Spaces, Tabs, And Other Special Characters
- C Program To Find Length Of String And Concatenate Two Strings
- C Program to calculate Area, Perimeter of Rectangle; Area, Circumference of Circle.
- C Program to find string length without library function
- C Program that prompts the user to input a string, (whitespaces allowed)
- Menu driven program in C to Calculate Length, Copy into Another Compare Concatenate of Two String