write program for palindrome

Answer Posted / faiz misbah

#include <stdio.h>
#include <stdlib.h>
int main ()
{
int i,j,f=0;
char a[10];
clrscr (); // only works on windows
gets(a);
for (i=0;a[i]!='\0';i++)
{
}
i--;
for (j=0;a[j]!='\0';j++,i--)
{
if (a[i]!=a[j])
{
printf("string is not palindrome");
return(0);
}
}

printf("string is palindrome");
return(0);
}

Is This Answer Correct ?    91 Yes 84 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write about an iterator class?

796


What is the use of data hiding?

764


Must accepts "Maestro Cards" Tax for bike should be less than 15 Total number of lanes is more than 10 Must provides monthly pass Write a method: boolean isGoodTollBridge(String[] cardsAccepted, String[] tollTax, boolean hasMonthlyPass, int numberOfLanes); String[] cardsAccepted A String array of names of card types accepted for payment of toll tax, it can be null if the toll does not accept any card String[] tollTax A String array of toll tax chart (say “Train : 300”,”BullCart : 10”) boolean hasMonthlyPass This parameter defines whether there is any monthly pass available or not int numberOfLanes This parameter defines the number of lanes for each side

3217


What are its advantages and disadvantages of multiple inheritances (virtual inheritance)?

812


Can comments be nested?

793






What is the history of c++?

719


Write a program to concatenate two strings.

767


What is scope operator in c++?

788


What do you mean by const correctness?

814


Can member functions be private?

768


Write a program using shift_half( ) function to shift the elements of first half array to second half and vice versa.

1012


Why #include is used?

783


What is a constructor and how is it called?

773


Can manipulators fall in love?

732


Do you know the use of vtable?

836