break continue

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package program;

/**
 *
 * @author Administrator
 */
public class BreakContinue{
    public static void main(String[] args) {
        int i,j;
        j=50;
        for(i=5; i>0; i--){
            if(j>100)
                break;
            j+=10;
            System.out.println("nilai i adalah "+i);
        }
        System.out.println("program berhenti i = "+i+" j="+j);
    }
}

0 komentar:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | SharePoint Demo