Source Code :
public class InputKonsolDua {
public static void main(String[] args) {
System.out.print("Masukkan bilangan a: ");
String str1 = System.console().readLine();
System.out.print("Masukkan bilangan b: ");
String str2 = System.console().readLine();
// method parseInt() digunakan untuk mengkonversi
// ke tipe integer
int a = Integer.parseInt(str1);
int b = Integer.parseInt(str2);
System.out.println("a + b = " + (a + b));
System.out.println("a - b = " + (a - b));
System.out.println("a * b = " + (a * b));
System.out.println("a / b = " + (a / b));
}
}
Outputnya :
Silahkan Copas Gannnn,,,,
Tapi Tolong Jangan Lupa Komentarnya yy gann,,,
5 comments:
wachh....trimakasih yachhh...sangat membantu..
okk gann,,, thkns gan sdh kunjungi blog saya :)
mksih yh gan :)
jgn lupa kunjungin website saya: nataliasisfo.simplesite.com
bro kalo perkalian seumpamanya
3x3 =
outputnya biar
3+3+3=9
gmn bro?
System.out.println("3+3+3 = " + (3 * 3));
:)) :)] ;)) ;;) :D ;) :p :(( :) :( :X =(( :-o :-/ :-* :| 8-} ~x( :-t b-( :-L x( =))
Post a Comment