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

Which is more efficient, a switch statement or an if else chain?

1045


What is the purpose of main( ) in c language?

1150


Explain what is the difference between #include and #include 'file' ?

1044


What is the difference between text and binary i/o?

1067


Why ca not I do something like this?

1023


Write a program that takes a 5 digit number and calculates 2 power that number and prints it(should not use big integers and exponential functions)

6888


Write a program to implement a round robin scheduler and calculate the average waiting time.Arrival time, burst time, time quantum, and no. of processes should be the inputs.

1122


What is function prototype?

1158


How do we make a global variable accessible across files? Explain the extern keyword?

1895


What is the difference between call by value and call by reference in c?

1177


Does sprintf put null character?

1055


Explain can the sizeof operator be used to tell the size of an array passed to a function?

1086


How can I open files mentioned on the command line, and parse option flags?

1081


How can I display a percentage-done indication that updates itself in place, or show one of those twirling baton progress indicators?

1042


Is register a keyword in c?

1053