That will the following code fragment display?

int n = 33;
int s = 0;
while (n > 0) {
    s += n % 2;
    n /= 2;
}
System.out.println(s);

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
Java quizzes
Cosmo
Sign Up Now
or Subscribe for future quizzes