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

Find string palindrome 10marks

Answer Posted / babitha

void main()
{
int a,len,palin;
char s[20];

scanf("%s",s);

len=strlen(s);
printf("%d \n",len);

for(a=0,len=len-1;a<len;a++,len--)
{
if(s[a]==s[len])
palin=1;

else
break;
}

if(palin==1)
printf("string %s is palindrome",s);
else
printf("string %s is not palindrome",s);

getch();

}

Is This Answer Correct ?    18 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is const and volatile in c?

1005


List some applications of c programming language?

924


Explain high-order bytes.

1082


Explain why can’t constant values be used to define an array’s initial size?

1330


What is the difference between array and linked list in c?

1108


Explain 'bit masking'?

1049


Write a program to reverse a string.

1045


What does %p mean?

1051


If a five digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits.For example if the number that is input is 12391 then the output should be displayed as 23402

3877


What is the data segment that is followed by c?

1050


how many errors in c explain deply

2056


Write a program to know whether the input number is an armstrong number.

1088


How does struct work in c?

1040


Do you know the difference between exit() and _exit() function in c?

1033


Why main function is special give two reasons?

1506