0

Im stuck and i cant get up

Help, pls, i dont understand, how can i get x=6, i can only get x=3, for some weird reason. int x = 1; for (int i=1; i<4; i++){ x*=i; System.out.println(x); }

25th Jan 2020, 10:45 PM
404 Ruthless
404 Ruthless - avatar
2 Réponses
+ 2
whenever u face problems like this, take the code and log it through print statements. In this case within the loop print x and i
26th Jan 2020, 3:46 AM
Oma Falk
Oma Falk - avatar