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
Write programs for String Reversal & Palindrome check
why to assign a pointer to null sometimes??how can a pointer we declare get assigned with a garbage value by default???
what is reason of your company position's in india no. 1.
What do you understand by normalization of pointers?
What is operator promotion?
What is the difference between array and structure in c?
In a switch statement, explain what will happen if a break statement is omitted?
Why is it important to memset a variable, immediately after allocating memory to it ?
How can I handle floating-point exceptions gracefully?
Here is a neat trick for checking whether two strings are equal
What are the types of variables in c?
what type of questions arrive in interview over c programming?
What is a program flowchart and how does it help in writing a program?
What does %p mean?
Want to know how to write a C program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.