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 the function of multilevel pointer in c?

1075


C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions

1049


When should the volatile modifier be used?

1167


What are the Advantages of using macro

1158


What is the difference between text files and binary files?

1340


What is Dynamic memory allocation in C? Name the dynamic allocation functions.

1400


I heard that you have to include stdio.h before calling printf. Why?

1057


What is the difference between declaring a variable and defining a variable?

1263


Explain how do you view the path?

1160


Find the second largest element in an array with minimum no of comparisons and give the minimum no of comparisons needed on an array of size N to do the same.

1267


When should we use pointers in a c program?

1124


Write a code to generate divisors of an integer?

1059


What does printf does?

1234


A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers

1179


Is null always equal to 0(zero)?

1027