looping


ini kode untuk mengeluarkan a ke b dan c

package looping;

public class Main {

public static void main(String[] args) {
int b=5;
int c=2;
int i=3;
for( i=0;i<6;i=i+2 )

{
System.out.println("a="+i);

System.out.println("b="+b);
b=b-3;

System.out.println("c="+c);

c=c+3;

} System.out.println("c="+c);

}
}

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s