ⒶⓎⓊⒹⓎⒶ ⓅⓊⓉⓇⒾ ⓅⓇⒶⓉⒾⓌⒾ

˙·٠•●♥ Ƹ̵̡Ӝ̵̨̄Ʒ ♥●•٠·˙˙·٠•●♥ Ƹ̵̡Ӝ̵̨̄Ʒ ♥●•٠·˙˙·٠•●♥ Ƹ̵̡Ӝ̵̨̄Ʒ ♥●•٠·˙˙·٠•●♥ Ƹ̵̡Ӝ̵̨̄Ʒ ♥●•٠·˙˙·٠•●♥ Ƹ̵̡Ӝ̵̨̄Ʒ ♥●•٠·˙˙·٠•●♥ Ƹ̵̡Ӝ̵̨̄Ʒ ♥●•٠·˙

1.Listing Deret lurus


import javax.swing.JOptionPane;

public class deret{

public static void main(String[]args){

String Str = null;

Str = JOptionPane.showInputDialog ("Masukkan nilai = ");

int nilai = Integer.parseInt(Str);

for (int i=1; i<=nilai; i++){

for (int j=1; j<=i; j++){

System.out.print(j);

System.out.println("");

}

}

}

}


2.Listing Deret segitiga


import javax.swing.JOptionPane;

public class deret1{

public static void main(String[]args){

String Str = null;

Str = JOptionPane.showInputDialog ("Masukkan nilai = ");

int nilai = Integer.parseInt(Str);

for (int i=1; i<=nilai; i++){

for (int j=1; j<=i; j++){

System.out.print(j);}

System.out.println("");}

}

}


0 komentar:

Posting Komentar

GUNADARMA

My Profil

Foto saya
Ayudya Putri Pratiwi NPM : 14109209 Kelas : 4KA25 Fakultas Ilmu Komputer dan Teknologi Informasi Jurusan : Sistem Informasi (2009) UNIVERSITAS GUNADARMA

Friends