write a program of palindrome(madam=madam) using pointer?
Answer Posted / ravinder singh rawat
#include<conio.h>
#include<stdio.h>
void main()
{ char *a,*count,s[11];
int i ;
printf("\n:enter string for Palindrome test\t");
scanf("%s",&s);
i= strlen(s);
a=(char *)malloc(i*sizeof(char));
a=&s[0];
count=&s[i-1];
while((*(a++)==*(count--)) && i>=1)
{ i--; }
if(i==0) { printf("\n%s is a palin",s);}
else { printf("\n%s is not palin",s);}
getch();
}
| Is This Answer Correct ? | 39 Yes | 7 No |
Post New Answer View All Answers
What is malloc and calloc?
How to find a missed value, if you want to store 100 values in a 99 sized array?
What is main return c?
Can you please explain the difference between malloc() and calloc() function?
What are the main characteristics of c language describe the structure of ac program?
Which built-in library function can be used to match a patter from the string?
What is calloc malloc realloc in c?
What is the condition that is applied with ?: Operator?
Explain the meaning of keyword 'extern' in a function declaration.
explain what are actual arguments?
In C language, a variable name cannot contain?
Explain bitwise shift operators?
‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S LENGTH .
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
What is #include stdio h and #include conio h?