package latihan_kabataku;
import java.util.Scanner;
/**
*
* @author Fachrul Ilmawan
*/
public class Latihan_kabataku {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
Scanner input = new Scanner(System.in);
double bil1,bil2,hasil1, hasil2,hasil3;
double hasil4,hasil5;
System.out.println("SEKARANG BELAJAR KA-BA-TA-KU dan MODULUS");
System.out.println();
System.out.print("Masukan Bilangan 1 :");
bil1=input.nextInt();
System.out.print("Masukkan Bilangan 2 :");
bil2=input.nextInt();
System.out.println();
hasil1=bil1+bil2;
hasil2=bil1-bil2;
hasil3=bil1*bil2;
hasil4=bil1/bil2;
hasil5=bil1 % bil2;
System.out.println("Hasil Penjumlahan");
System.out.println(+bil1+"+"+bil2+"="+hasil1);
System.out.println("Hasil Pengurangan");
System.out.println(+bil1+"-"+bil2+"="+hasil2);
System.out.println("Hasil Perkalian");
System.out.println(+bil1+"*"+bil2+"="+hasil3);
System.out.println("Hasil Pembagian");
System.out.println(+bil1+"/"+bil2+"="+String.format("%.2f",hasil4) );
System.out.println("Hasil Bagi (MODULUS)");
System.out.println(+bil1+"/"+bil2+"="+hasil5);
}
}
import java.util.Scanner;
/**
*
* @author Fachrul Ilmawan
*/
public class Latihan_kabataku {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
Scanner input = new Scanner(System.in);
double bil1,bil2,hasil1, hasil2,hasil3;
double hasil4,hasil5;
System.out.println("SEKARANG BELAJAR KA-BA-TA-KU dan MODULUS");
System.out.println();
System.out.print("Masukan Bilangan 1 :");
bil1=input.nextInt();
System.out.print("Masukkan Bilangan 2 :");
bil2=input.nextInt();
System.out.println();
hasil1=bil1+bil2;
hasil2=bil1-bil2;
hasil3=bil1*bil2;
hasil4=bil1/bil2;
hasil5=bil1 % bil2;
System.out.println("Hasil Penjumlahan");
System.out.println(+bil1+"+"+bil2+"="+hasil1);
System.out.println("Hasil Pengurangan");
System.out.println(+bil1+"-"+bil2+"="+hasil2);
System.out.println("Hasil Perkalian");
System.out.println(+bil1+"*"+bil2+"="+hasil3);
System.out.println("Hasil Pembagian");
System.out.println(+bil1+"/"+bil2+"="+String.format("%.2f",hasil4) );
System.out.println("Hasil Bagi (MODULUS)");
System.out.println(+bil1+"/"+bil2+"="+hasil5);
}
}
Komentar
Posting Komentar