Kalkulator.java

import java.util.Scanner;
public class Kalkulator {
public static void main(String[]args)throws Exception{
int a;
int b;
Scanner input = new Scanner(System.in);
System.out.print(“masukan nilai a: “);
a = input.nextInt();
System.out.print(“masukan nilai b: “);
b = input.nextInt();

int c=a+b ;
int d=a-b ;
int e=a*b ;

System.out.println(“\nnilai a = “+a);
System.out.println(“nilai b = “+b);
System.out.println(“\nmaka..”);
System.out.println(“a + b = “+c);
System.out.println(“a – b = “+d);
System.out.println(“a * b = “+e);
}}

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s