Minggu, 17 Januari 2010

Procedure Palindrom di C++

//Procedure kata polindrom
void polindrom(char kata[]){
int awal=0;
int akhir=strlen(kata)-1;
bool cek=true;
do
{
if (kata[awal]==kata[akhir])
{
awal++;
akhir--;
}
else cek=false;
}
while( cek && awal<=akhir);
if (cek)
cout<<"Polindrom\n";
else
cout<<"Bukan Polindrom\n";
}

0 comments:

Posting Komentar

Twitter Delicious Facebook Digg Stumbleupon Favorites More

Enter your email address to subscribe:

Delivered by FeedBurner

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | SharePoint Demo