Wednesday, February 4, 2009

Palindrom

program palindrom;
uses wincrt;
var kt,huruf,huruf1:string;
i,j : integer;
begin
writeln('Write a word : ');readln(kt);
writeln;
j:=length(kt);
huruf:='';
for i:=1 to j do
huruf:=huruf + kt[i];
for i:=j downto 1 do
huruf1:=huruf1 + kt[i];
writeln('Origin Word: ',huruf);
writeln('the reverse side : ',huruf1);
writeln;
if (huruf=huruf1) then
writeln('this word included in Palindrom')
else
writeln('this word not included in Palindrom');
end.

if we run the statement,we are get output like this :

polindrom

2 comments:

Anonymous said...

mas. ana ikutan download ya. ada tugas tentang polindrom. salam kenal ya.

rick said...

oke silahkan