Skip to content

Instantly share code, notes, and snippets.

@nherbaut
Last active September 12, 2023 13:29
Show Gist options
  • Select an option

  • Save nherbaut/4e3fa165063d5c2db6cb38ca272fa82d to your computer and use it in GitHub Desktop.

Select an option

Save nherbaut/4e3fa165063d5c2db6cb38ca272fa82d to your computer and use it in GitHub Desktop.
L2.1.7 Les conditions.4

Pour quelles valeurs de a et b est-ce que k vaut 2?

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