Created
December 8, 2016 01:22
-
-
Save nazmul202101/1616a3f66d7007f46623b19ee3d34c9b to your computer and use it in GitHub Desktop.
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
//Given two int values, return their sum. Unless the two values are the same, then return double their sum. | |
//sumDouble(1, 2) → 3 | |
//sumDouble(3, 2) → 5 | |
//sumDouble(2, 2) → 8 | |
public int sumDouble(int a, int b) { | |
if(a==b){ | |
return a+b; | |
} | |
else{ | |
return a+b*2; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment