Upcoming SlideShare
×

# &Y tgs P kii for

573
-1

Published on

0 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

• Be the first to like this

Views
Total Views
573
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
3
0
Likes
0
Embeds 0
No embeds

No notes for slide

### &Y tgs P kii for

1. 1. TUGAS PEMROGRAMAN KOMPUTER II looping Nama : Oktavian Dani E Jurusan : Ti’08 A NIM : 08.11.0578 1. class TgFor01 { public static void main (String arg []) { for(int i=1;i<=10;i=i+1) {System.out.print(i+", ");} } } Output:
2. 2. 2. class TgFor02 { public static void main (String arg []) { for(int i=50;i>=40;i=i-2) {System.out.print(i+", ");} } } Output: 3. class TgFor03 { public static void main (String arg []) { for(int i=13;i<=25;i=i+2) {System.out.print(i+", ");} } } Output:
3. 3. 4. class TgFor04 { public static void main (String arg []) { int j=0; for(int i=4;i<=8;i=i+2) {j=j+4; System.out.println("a= "+i); System.out.println("b= "+j); } } } Output: 5. class TgFor05 { public static void main (String arg []) { int j=4; for(int i=2;i<=8;i=i+3) { System.out.println("a= "+i); System.out.println("b= "+j); } } } Output:
4. 4. 6. class TgFor06 { public static void main (String arg []) { int j=9; for(int i=7;i>=1;i=i-4) { j=j-4; System.out.println("a= "+i); System.out.println("b= "+j); } } } Output: 7. class TgFor07 { public static void main (String arg []) { for(int i=1;i<=5;i=i+2) { System.out.println("a= "+i); } for(int j=6;j<=10;j=j+2) { System.out.println("b= "+j); } } } Output:
5. 5. 8. class TgFor08 { public static void main (String arg []) { int j=0; int k=13; int l=-1; for(int i=3;i<7;i=i+3) { l=l+2; j=j+2; k=k-3; System.out.println("No "+l+" Data a= "+i); System.out.println("No "+j+" Data b= "+k); } } } Output: