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 / mojib khan

#include<stdio.h>

void main()
{
int i=0,l,flag=0;
char str[30];
clrscr();
printf("Enter the string\n");
gets(str);
l=strlen(str)-1;
while(i<=l)
{
if(str[i]==str[l])
flag=1;
else
{
flag=0;
break;
}
i++;
l--;
}
if(flag==1)
printf("String is palindrom");
else
printf("\n String is not palindrom");
getch();
}

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the characteristics of friend functions?

1073


Differentiate between a copy constructor and an overloaded assignment operator.

1140


What is flush () in c++?

1126


What is a float in c++?

1029


Differentiate between declaration and definition.

1103


What is time_t c++?

1204


What is class definition in c++ ?

1140


Which function should be used to free the memory allocated by calloc()?

1066


What is the prototype of printf function?

1234


Difference between overloading vs. Overriding

1138


What header file is needed for exit(); a) stdlib.h b) conio.h c) dos.h

1110


What are vtable and vptr?

1197


What is the maximum value of a unsigned char a) 255 b) 256 c) 128

1120


State two differences between C and C++.

1247


what is oops and list its features in c++?

1112