Skip to content

Instantly share code, notes, and snippets.

@PocasPedro
Created October 2, 2017 13:59
Show Gist options
  • Save PocasPedro/e0aa32848f77be1ec764922be96e7b13 to your computer and use it in GitHub Desktop.
Save PocasPedro/e0aa32848f77be1ec764922be96e7b13 to your computer and use it in GitHub Desktop.
Java Fundamentals for Kids - Exercise 4
/**
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