Created
October 2, 2017 13:59
-
-
Save PocasPedro/e0aa32848f77be1ec764922be96e7b13 to your computer and use it in GitHub Desktop.
Java Fundamentals for Kids - Exercise 4
This file contains 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
/** | |
Program that divides 22/3 and displays the format in different data types | |
*/ | |
public class Calculator3 { | |
public static void main(String[] args) { | |
int op1 = 22; | |
int op2 = 3; | |
int intres = op1 / op2; | |
double doures = op1 / op2; | |
float flores = op1 / op2; | |
// Prints the variable results to the terminal window. | |
System.out.println("The result in int is " + intres); | |
System.out.println("The result in double is " + doures); | |
System.out.println("The result in float is " + flores); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment