Find string palindrome 10marks
Answer Posted / abhilash meda
#include"string.h"
void main()
{
char *str,*rev;
int i,j;
clrscr();
printf("\nEnter a string:");
scanf("%s",str);
for(i=strlen(str)-1,j=0;i>=0;i--,j++)
rev[j]=str[i];
rev[j]='\0';
if(strcmp(rev,str))
printf("\nThe string is not a palindrome");
else
printf("\nThe string is a palindrome");
getch();
}
| Is This Answer Correct ? | 1 Yes | 4 No |
Post New Answer View All Answers
a direct address that identifies a location by means of its displacement from a base address or segment a) absolute address b) relative address c) relative mode d) absolute mode
Which programming language is best for getting job 2020?
Is c is a high level language?
What are the different data types in C?
How can I write data files which can be read on other machines with different word size, byte order, or floating point formats?
C program to find all possible outcomes of a dice?
How can I write a function analogous to scanf?
how to print electricity bill according to following charges first 100 units -1rs per unit for next 200 units-1.50 rs per unit without using conditions
What is c programming structure?
In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none
Why c is called a middle level language?
What functions are used for dynamic memory allocation in c language?
Can you write the function prototype, definition and mention the other requirements.
What is new line escape sequence?
Write a C program to count the number of email on text