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 program for palindrome

Answer Posted / niruj

/* without using string.h library */
#include<stdio.h>
#include<conio.h>
void main()
{
char *p;
char a[]="malyalam";
char rev[10];
int i;
int len=sizeof(a);
p=a;
do{
p++;
}while(*p!=NULL);
*p='\0';
i=0;
do{
p--;
rev[i]=*p;
i++;
}while(p!=a);
for(i=0;i<=len-2;i++)
{
if(a[i]==rev[i])
{
if(i==len-2)
{
printf("String is Pallindrom");
}
}
else{
printf("String is not pallindrom");
break;
}
}
getch();

}

Is This Answer Correct ?    5 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is an accessor in c++?

1068


Is it possible for a member function to delete the pointer, named this?

1155


What do you mean by global variables?

1074


Write an algorithm that determines whether or not an almost complete binary tree is a heap.

3909


What is type of 'this' pointer?

1058


What do you understand by pure virtual function? Write about its use?

999


What is purpose of new operator?

1071


What are all predefined data types in c++?

1122


Explain virtual destructor?

1188


How do you add an element to a set in c++?

990


How can you quickly find the number of elements stored in a static array?

1090


What are virtual functions in c++?

1179


Define a constructor - what it is and how it might be called (2 methods)?

1129


Which is most difficult programming language?

1098


Do the parentheses after the type name make a difference with new?

1081