Rabu, 28 Agustus 2013

Membuat Sistem Input User dengan Java

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Class;

import java.util.Scanner;

/**
 *
 * @author Trisandiyana
 */
public class InputUser {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here

        while (true) {

        Scanner input = new Scanner(System.in);
            System.out.println("");
        System.out.println("Masukkan angka pertama : ");
        int angka1 = input.nextInt();
        System.out.println("Masukkan angka kedua : ");
        int angka2 = input.nextInt();
        int hasil = angka1 - angka2;
        System.out.println("Hasil pengurangan adalah : "+hasil);
        System.out.println("Terima Kasih :) ");
        
        }
        

}
}

Tidak ada komentar:

Posting Komentar