Skip to content

Instantly share code, notes, and snippets.

@nherbaut
Created September 12, 2023 12:17
Show Gist options
  • Select an option

  • Save nherbaut/43a87ac01506876e53a4fe50a59088e4 to your computer and use it in GitHub Desktop.

Select an option

Save nherbaut/43a87ac01506876e53a4fe50a59088e4 to your computer and use it in GitHub Desktop.
L2.1.4 Opérations arithmétiques sur les types primitifs

Que vaut x après la dernière ligne?

public class L2MIASHS{
public static void main(String ...args){
int x=2;
int y = x*3;
int z = y / 2;
x = ( 2 + z ) % 2; // avant de lancer le calcul, essayez de deviner la valeur de x
System.out.println(x);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment