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
What is s in c?
What is const volatile variable in c?
What do you know about the use of bit field?
Explain how can I avoid the abort, retry, fail messages?
struct screen_pos{ int row, col } ;move_right(cursor)struct screen_pos *cursor;{ cursor.col++; } /* This statementhas a syntax error */What is the correct statement a) cursor.col = cursor.col + 1; b) col.cursor++; c) *cursor.col++; d) pointer
What is the full form of getch?
Hi can anyone tell what is a start up code?
What is the difference between call by value and call by reference in c?
what is uses of .net
‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.
How main function is called in c?
What is external variable in c?
Is int a keyword in c?
What Is The Difference Between Null And Void Pointer?
How can I call a function with an argument list built up at run time?