How to palindrom string in c language?

Answer Posted / sandeep

#include<stdio.h>
#include<conio.h>
void main()
{
char n[6];
int i,l;
clrscr();
printf("enter string");
scanf("%s",n);
l=strlen(n);
if((l%2)==0)
exit(0);//length of string is even and cant be a palindrome
for(i=1;i<l/2;i++)
{
if(n[i]==n([l/2+i)])
i++;
else
printf("string is not palindrome");
}
getch();
}

Is This Answer Correct ?    3 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Set up procedure for generating a wire frame display of a polyhedron with the hidden edges of the object drawn with dashed lines

3310


Hi, i have a project that the teacher want a pyramid of numbers in C# or java...when we click a button...the pyramid should be generated in a listbox/or JtextArea...and the pyramid should have the folowing form: 1 232 34543 4567654 567898765 67890109876 7890123210987 890123454321098 90123456765432109 0123456789876543210 Plz help with codes...didn't find anything on the net.

2950


can you use proc sql to manpulate a data set or would u prefer to use proc report ? if so why ? make up an example and explain in detail

2617


how to create a 3x3 two dimensional array that will give you the sums on the left and bottom columns

3408


why do you use macros? Explain a situation where you had to incorporate macros in your proc report? use a simple instream data example with code ?

2571


How to palindrom string in c language?

10028


How can you relate the function with the structure? Explain with an appropriate example.

3184


could you please send the program code for multiplying sparse matrix in c????

3344


Write a routine to implement the polymarker function

4634


write a program for area of circumference of shapes

2296


Develop a routine to reflect an object about an arbitrarily selected plane

3349


how to test pierrot divisor

2517


Given a spherical surface, write bump-mapping procedure to generate the bumpy surface of an orange

3125


What is full form of PEPSI

2179


write a function to give demostrate the functionality of 3d in 1d. function prototye: change(int value,int indexX,int indexY,int indexZ, int [] 1dArray); value=what is the date; indexX=x-asix indexY=y-axis indexZ=z-axis and 1dArray=in which and where the value is stored??

4437