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...

How to check whether string is a palindrome, WITHOUT USING
STRING FUNCTIONS?

Answer Posted / narasimharao

#include<stdio.h>
#include<conio.h>
void main()
{
char str[20]="malayalam",str1[20];
int i,j,k,c;
clrscr();
for(c=0;str[c]!='\0';c++)
{
}
printf("%d\n",c);
for(i=c-1,j=0;i>=0;i--,j++)
{
str1[j]=str[i];
}
printf("%s\n",str1);
k=1;
for(i=0;str[i]!='\0';i++)
{
if(str[i]!=str1[i])
{
k=0;
break;
}
}
if(k==1)
printf("Given String is Palindrome");
else
printf("Given String is Not Palindrome");
getch();
}

Is This Answer Correct ?    10 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I change the size of the dynamically allocated array?

1144


Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;

1068


What is sizeof return in c?

1032


What is cohesion in c?

980


What is difference between arrays and pointers?

1063


What is table lookup in c?

1098


How can I read/write structures from/to data files?

969


In c language can we compile a program without main() function?

1130


What is a struct c#?

1047


How can you find the day of the week given the date?

1197


State the difference between realloc and free.

1070


Can one function call another?

1112


Is printf a keyword?

1196


What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.

2257


What is the difference between ++a and a++?

1203