write program for palindrome
Answer Posted / prakash
#include<stdio.h>
#include<conio.h>
main()
{
char s1[10],s2[10];
int m,i,j;
scanf("%s",s1);
strcpy(s2,s1);
m=strlen(s1);
for(i=0,j=m-1;i<=m-1,j<=0;i++,j--)
{
if(s1[i]!=s2[j])
printf("STRING IS NOT PALINDROME ");
}
printf("STRING IS a PALINDROME ");
getch();
}
| Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
What is array give example?
Do you know what are the new features that iso/ansi c++ has added to original c++ specifications?
Explain what are accessor methods?
Would you rather wait for quicksort, linear search, or bubble sort on a 200000 element array? (Or go to lunch...) a) Quicksort b) Linear Search c) Bubble Sort
Is it possible to pass an object of the same class in place of object reference to the copy constructor?
What are iterators in c++?
What header file is needed for exit(); a) stdlib.h b) conio.h c) dos.h
What is meant by a delegate?
What is the extension of c++?
What is constant in c++ with example?
Difference between declaration and definition of a variable.
We use library functions in the program, in what form they are provided to the program?
Is multimap sorted c++?
How can I learn c++ easily?
How the delete operator differs from the delete[]operator?