Last active
September 24, 2016 18:03
-
-
Save peterkos/68311cb3c31274cd2f62 to your computer and use it in GitHub Desktop.
Inputs two integers and outputs an integer with a fake decimal, i.e. (int division result).(remainder)
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
private static int addTwoIntegers(int firstValue, int secondValue) { | |
int intResult = 0; | |
int remainderResult = 0; | |
intResult = firstValue / secondValue; | |
remainderResult = firstValue % secondValue; | |
System.out.printf("firstValue divided by secondVlaue is %s.%s\n", intResult, remainderResult); | |
//Same as above statement, but with println instead of printf | |
//System.out.println("firstValue divided by secondValue is " + intResult + "." + remainderResult); | |
return intResult; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment