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


Please Help Members By Posting Answers For Below Questions

Write a program for Overriding.

892


What is substring in c?

844


What is the use of a conditional inclusion statement in C?

806


Explain what is the benefit of using #define to declare a constant?

785


Can I initialize unions?

794






What are different types of pointers?

757


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?

1854


What is string concatenation in c?

752


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

2774


write a program to print data of 5 five students with structures?

1815


Explain logical errors? Compare with syntax errors.

804


What’s the special use of UNIONS?

848


Explain how do you determine a file’s attributes?

788


What is page thrashing?

833


What is the purpose of macro in C language?

841