Explore what CodeHS has to offer for districts, schools, and teachers.
Click on one of our programs below to get started coding in the sandbox!
View All
What is the output of the following code snippet?
int[] scores = {51, 92, 47, 33, 81}; for(int score : scores) { score = 5; } for(int score : scores) { System.out.println(score); }
5 92 47 33 81
5 5 5 5 5
51 92 47 33 81
5
51 92 47 33 5