Created
December 9, 2018 13:38
-
-
Save ilhamarrouf/9f1c2bb2c4b286858cf9fd7922fc9d34 to your computer and use it in GitHub Desktop.
Introduction to Programming
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Number { | |
public static void main(String[] args) { | |
Scanner reader = new Scanner(System.in); | |
System.out.print("Masukkan angka pertama: "); | |
long a = Integer.parseInt(reader.nextLine()); | |
System.out.print("Masukkan angka kedua: "); | |
long b = Integer.parseInt(reader.nextLine()); | |
System.out.println("Bilangan terbesar: " + Math.max(a, b)); | |
System.out.println("Bilangan terkecil: " + Math.min(a, b)); | |
System.out.println(a +"^" + b + " = " + (long) Math.pow(a, b)); | |
System.out.println(a +"^2 = " + (long) Math.pow(a, 2)); | |
System.out.println(b +"^2 = " + (long) Math.pow(b, 2)); | |
reader.close(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment