&Y tgs P kii for
Upcoming SlideShare
Loading in...5
×
 

&Y tgs P kii for

on

  • 807 views

 

Statistics

Views

Total Views
807
Slideshare-icon Views on SlideShare
798
Embed Views
9

Actions

Likes
0
Downloads
2
Comments
0

3 Embeds 9

http://www.danikhoe.blogspot.com 6
http://danikhoe.blogspot.com 2
http://www.slideshare.net 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    &Y tgs P kii for &Y tgs P kii for Document Transcript

    • 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. 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:
    • 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:
    • 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:
    • 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: