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 is pointer initialized in c?

975


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

1183


What is calloc() function?

1047


Explain do array subscripts always start with zero?

1174


What do you mean by keywords in c?

1080


What is the meaning of c in c language?

1072


Find MAXIMUM of three distinct integers using a single C statement

1011


What is the heap?

1153


What is the maximum length of an identifier?

1129


What is substring in c?

1131


What are directives in c?

923


What is use of null pointer in c?

957


Differentiate between the = symbol and == symbol?

1207


What is the purpose of clrscr () printf () and getch ()?

1020


Can we compile a program without main() function?

1073