Skip to content

Instantly share code, notes, and snippets.

@gitaficionado
Created September 20, 2019 01:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gitaficionado/7bbab7dc4da5631a7310e99f86cc3bae to your computer and use it in GitHub Desktop.
Save gitaficionado/7bbab7dc4da5631a7310e99f86cc3bae to your computer and use it in GitHub Desktop.
(Print a table) Write a program that displays the following table. Cast floating-point numbers into integers. See page 68 for more information.
public class PrintTableWithCasting_02_18 {
// Main method
public static void main(String[] args) {
System.out.println("a b _____(a, b)");
System.out.println("1 2 " + (___)____.___(1, 2));
System.out.println("2 3 " + (___)____.___(2, 3));
System.out.println("3 4 " + (__)___.___(3, 4));
System.out.println("4 5 " + (___)___.__(4, 5));
System.out.println("5 6 " + (___)____.___(5, 6));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment