-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEx4.java
More file actions
27 lines (22 loc) · 941 Bytes
/
Copy pathEx4.java
File metadata and controls
27 lines (22 loc) · 941 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import java.util.Scanner;
// Write a Java program to allow the user to input two integer values
// and then the program prints the results of adding
// substracting, multiplying , and dividing among the two values..
public class Ex4 {
public static void main (String [] args) {
Scanner lector = new Scanner (System.in);
System.out.println( " Ingresa el primer valor A entero: ");
int numOne = lector.nextInt();
System.out.println( " Ingresa el segundo valor B entero: ");
int numTwo = lector.nextInt();
int Sum_ar = numOne + numTwo;
int res_tar = numOne - numTwo;
int mult = (numOne + numTwo);
float numOnef = numOne + 0.0f;
float div = (numOnef/numTwo);
System.out.println( " Suma de A + B = " + Sum_ar);
System.out.println( " Resta de A - B = " + res_tar);
System.out.println( " Multiplicacion de A * B = " + mult);
System.out.println( " Division de A / B = " + div);
}
}