Pour quelles valeurs de a et b est-ce que k vaut 2?
Last active
September 12, 2023 13:29
-
-
Save nherbaut/4e3fa165063d5c2db6cb38ca272fa82d to your computer and use it in GitHub Desktop.
L2.1.7 Les conditions.4
This file contains hidden or 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
| 2 |
This file contains hidden or 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
| public class TypesL2 { | |
| static int k (int a, int b) { | |
| if (a < b) { | |
| if (b > 4) { | |
| return 0 ; | |
| } | |
| else { | |
| return 1; | |
| } | |
| } | |
| else { | |
| if (a > 4) { | |
| return 2; | |
| } | |
| else { | |
| return 3; | |
| } | |
| } | |
| } | |
| public static void main(String... args) { | |
| int a=?; | |
| int b=?; | |
| int returnValue = k(a,b); | |
| System.out.println(returnValue); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment