Jumat, 30 Desember 2011

Program looping dengan java

import java.util.Scanner;
public class dowhile_looping
{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
int b=1;

do
{
System.out.print("Perulangan menuju angka : ");
int n = in.nextInt();
System.out.print("=>  ");
b++;
for(int a=1;a<=n;a++)
{
System.out.print(a);
System.out.print(" ");
}
System.out.println(" ");
System.out.println(" ");
}while(b<=5);
}
}

0 komentar:

Posting Komentar

Statistik

Translate

Blog Archive