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 array in c++ pdf?

1286


What is expression parser in c++

2562


Is c++ platform dependent?

1147


What is istream and ostream in c++?

1203


What does it mean to declare a destructor as static?

1153


Do you know about latest advancements in C++ ?

1339


What apps are written in c++?

1141


How many types of scopes are there in c++?

1168


When do we run a shell in the unix system? How will you tell which shell you are running?

1025


Define the process of error-handling in case of constructor failure?

1056


Search for: what is pair in c++?

1175


Discussion on error handling of C++ .

1161


What are compilers in c++?

1106


What are the advantages of using const reference arguments in a function?

1119


How can you prevent accessing of the private parts of my class by other programmers (violating encapsulation)?

1127