Menentukan Palindrome

Judul : Menentukan Algoritma Palindrome

Deskripsi :
a.Input satu buah kata
b.Inisialisasi string
c.Tampilkan kata yang sudah diinput oleh user
d.Simpan sementara kata tersebut di dalam StringBuffer
f.Jika hasil Palindrome, maka tampilkan “Yes!!! Ini palindrome”
g.Jika tidak, maka tampilkan “ini bukan Palindrome

Program dalam java :

public class Tugas1 {
public static void main(String [] args) throws IOException
StringBuffer sb;
BufferedReader input = new BufferedReader(new InputStreamReader(;
System.out.println("Input satu kata: ");
String s1 = input.readLine();
sb = new StringBuffer(s1);
System.out.println("Yes!!! ini palindrome");
System.out.println("ini bukan palindrome");

About Sheilla Rizkia Ferianty


Posted on 01/12/2011, in Java. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: