Que vaut x après la dernière ligne?
Created
September 12, 2023 12:17
-
-
Save nherbaut/43a87ac01506876e53a4fe50a59088e4 to your computer and use it in GitHub Desktop.
L2.1.4 Opérations arithmétiques sur les types primitifs
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 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