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
Write about an iterator class?
What is the use of data hiding?
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
What are its advantages and disadvantages of multiple inheritances (virtual inheritance)?
Can comments be nested?
What is the history of c++?
Write a program to concatenate two strings.
What is scope operator in c++?
What do you mean by const correctness?
Can member functions be private?
Write a program using shift_half( ) function to shift the elements of first half array to second half and vice versa.
Why #include is used?
What is a constructor and how is it called?
Can manipulators fall in love?
Do you know the use of vtable?