Tuesday, 16 February 2010


import java.io.*;
public class CobaFor2{
public static void main(String args[])throws IOException{
int awal,akhir;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
try{
System.out.print("masukkan nilai awal i : ");
awal = Integer.parseInt(br.readLine());
System.out.print("Masukkan batas nilai i :");
akhir = Integer.parseInt(br.readLine());
for (int i = awal;i<=akhir; i++){
System.out.println(i);
}
}catch(NumberFormatException nfe){
System.out.println("Error");
}
}
}




0 komentar:

Post a Comment

Iklan

rss


Translate

Chat

Komentar Blog

Iklan