Java Codes
--+o0O0o+--
Write a program that asks the user to enter 2 numbers, and display the SUM,
DIFFERENCE, PRODUCT, QUOTIENT and REMAINDER of the 2 numbers.
import java.util.Scanner;
public class MachineProblem1 {
public static
void main(String[] args) {
Scanner
input_user = new Scanner(System.in);
float
fi,se;
System.out.print("Enter First Number: ");
fi = input_user.nextFloat();
System.out.print("Enter
Second Number: ");
se = input_user.nextFloat();
System.out.println("******************************************");
System.out.println(" SUM ---------->(fi +
se));
System.out.println("******************************************");
System.out.println("
DIFFERENCE --->(fi -
se));
System.out.println("******************************************");
System.out.println(" PRODUCT
------>(fi *
se));
System.out.println("******************************************");
System.out.println("
QOUTIENT ----->(fi /
se));
System.out.println("******************************************");
System.out.println("
REMAINDER ---->(fi %
se));
System.out.println("******************************************");
}
}
Walang komento:
Mag-post ng isang Komento