Jumat, 15 November 2013

Program Perulangan 1 pada JAVA

 import java.util.*;
public class segitiga {

    public static void main(String[] args) {
  
        Scanner input = new Scanner(System.in);
        int a,b,c;
  
        System.out.print("Masukan Angka : ");
        a = input.nextInt();
    
        for(b=1;b<=a;b++)
        {
             for(c=1;c<=b;c++)
             {
                  System.out.print("* ");
             }
        System.out.println("");
        }   
  
        System.out.println("\n\n");              
    }
   
}

0 komentar:

Posting Komentar

Please Leave Your Comment :)