Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class nested_loop {
- public static void main(String[] args) {
- System.out.print("Perencanaan Perjalanan selama setahun");
- for(int month = 1; month <= 12 ;month++) {
- System.out.printf("Bulan Ke.%d : ", month);
- for(int m = 1; m <= 12 ;m++) {
- if(month == 1) {
- System.out.println("Malaysia & Singapur");
- break;
- }else if (month == 2) {
- System.out.println("Surabaya & Malang");
- break;
- }else if(month == 3) {
- System.out.println("Palembang & Manado");
- break;
- }else if (month == 4) {
- System.out.println("Jogja & Semarang");
- break;
- }else if (month == 5) {
- System.out.println("Kalimantan & Padang");
- break;
- }else if (month == 6) {
- System.out.println("Jambi & Batam");
- break;
- }else if (month == 7) {
- System.out.println("Mekah & Madinah");
- break;
- }else if (month == 8) {
- System.out.println("Yaman & Oman");
- break;
- }else if (month == 9) {
- System.out.println("Dubai & Mesir");
- break;
- }else {
- System.out.println("Medan & Aceh");
- break;
- }
- }
- System.out.println();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment