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
Write a program for Overriding.
What is substring in c?
What is the use of a conditional inclusion statement in C?
Explain what is the benefit of using #define to declare a constant?
Can I initialize unions?
What are different types of pointers?
hai iam working in sap sd module for one year and working in lumax ind ltd in desp department but my problem is i have done m.b.a in hr/marketing and working sap sd there is any combination it. can you give right solution of my problem. and what can i do?
What is string concatenation in c?
what is the c source code for the below output? 5555555555 4444 4444 333 333 22 22 1 1 22 22 333 333 4444 4444 5555555555
write a program to print data of 5 five students with structures?
Explain logical errors? Compare with syntax errors.
What’s the special use of UNIONS?
Explain how do you determine a file’s attributes?
What is page thrashing?
What is the purpose of macro in C language?