Home » , » Program Bintang Segitiga siku-siku

Program Bintang Segitiga siku-siku


Program Java : Program bintang segitiga siku -siku dengan menggunakan metode input Scanner

import java.util.Scanner;
public class bintangsegitiga{
     public static void main(String[] args) {
     Scanner data = new Scanner(System.in);
     System.out.print("Masukkan banyak baris : ");
     int nilai = data.nextInt();
     int j,i;
     for (i=1;i<=nilai ;i++ )
    {
          for (j=1;j<=i ;j++ )
    {
    System.out.print("*");
    }
    System.out.println();
   }
   }
}

Hasilnya seperti berikut :




 
Support : Creating Website | Mas Template
Copyright © 2011. Pohon Tua Blogspot - All Rights Reserved
Template modify by Pohon Tua Blog
Proudly powered by Blogger