Palindrome is a string,which when read in both forward and backward way in same.
Example:-madam,radar,rotavator
#include<stdio.h>
char string_palin(char str[]);
int main()
{
char str[30];
clrscr();
printf("Enter string : ");
scanf("%s",&str);
if(string_palin(str))
printf("Entered string Palindrome");
else
printf("Entered string not Palindrome");
getch();
return 0;
}
/*function for palindrome*/
char string_palin(char str[])
{
int i,j;
for(i=0; str[i]!=NULL; i++);
for(j=0,i--; j<=i; )
{
if(str[i]==str[j])
{
i--;
j++;
}
else
break;
}
if(j>i)
return(1);
else
return(0);
}
Enjoy learning new things and you want to get as good a grip as possible on how things work and best ways to use information technology. Visit my other blogs here:: http://thissasinfobahn.blogspot.com/:: http://thissann.blogspot.com/:: http://thissanetworkz.blogspot.com/
Subscribe to:
Post Comments (Atom)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzLTAxgZ2hYiBotPYTM5T1yyVKb-lhqSlv9GtC4HSQLZiRTVCIlBmAu5VQpNOU_IQzvsjp2KpGZ0J48ZM8V9XNOiX7X6Y4Xk74I4MVIcHERpXStA3V5tIchR65w4hI8c9QFP1W2nbl6jT_orxKQwiwHjYvqcJvnZKCIjHS0MmeVZVOj3mZeeqym3Yq/w400-h400/1211.jpg)
-
අංකිත බෙදීම( Digital Divide) තොරතුරු හා සන්නිවේදන තාක්ෂණය මිනිසුන් අතර ප්රචලිත වූවාසේම එම තාක්ෂණය ලොව සැමටම එකම ආකාරයකට බුක්තිවිදිය නොහැක...
-
කළමනාකරණ තොරතුරු පද්ධති ( Management information system) ආයතනයක තොරතුරු ගලායාමේ ව්යුහය සැලකූ විට මූලික මට්ටම් 3 ක් පවතී.ඉන් ඉහලම මට්ටමේ...
No comments:
Post a Comment