Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

What is FIFO?

1663


What are the differences between new and malloc in C?

1125


Q.1 write aprogram to stack using linklist o insert 40 items? Q.2 write a program to implement circular queue with help of linklist?

2099


Explain what is wrong with this program statement? Void = 10;

1245


What is typedef?

1398


int i=3; this declaration tells the C compiler to a) reserve space in memory to hold the integer value b) associate the name i with this memory location c) store the value 3 at this location d) all the above

1279


How can you increase the size of a dynamically allocated array?

1170


can any one please explain, how can i access hard disk(physical address)? it is possible by the use of far,near or huge pointer? if yes then please explain......

1855


Explain what is a const pointer?

1071


What are keywords in c with examples?

1073


How is a macro different from a function?

1155


Explain what will be the outcome of the following conditional statement if the value of variable s is 10?

1234


How can I remove the trailing spaces from a string?

1061


How do I use void main?

1081


Explain how can I convert a string to a number?

1076