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
Explain how do you list a file’s date and time?
Write a program to generate random numbers in c?
Write a code to generate divisors of an integer?
What are Macros? What are its advantages and disadvantages?
What does the error 'Null Pointer Assignment' mean and what causes this error?
in multiple branching construct "default" case is a) optional b) compulsarily c) it is not include in this construct d) none of the above
Difference between constant pointer and pointer to a constant.
What happens if you free a pointer twice?
What is getch () for?
What extern c means?
How is a null pointer different from a dangling pointer?
c program for searching a student details among 10 student details
Explain how many levels deep can include files be nested?
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 value paradox explain?