Fix the Loop, Then Read It

Medium

countAbove should count how many readings are strictly greater than limit, but its comparison is wrong: it currently counts every positive element. Fix the condition so the program prints the three correct counts. Then apply the capstone method in the assembly panel at -O2: sketch the flow graph from the labels and jumps, then identify the cmp that compares an element against limit, the conditional jump that skips the increment when the element does not qualify, and the backward jump at the bottom that is the loop's back-edge.

Success Criteria

Your code must pass 1 test case(s) to complete this exercise. 3 hint(s) are available if you need help.

Sign in to track your progress

You can work on exercises as a guest, but sign in to track your progress and save your submissions.

This platform is built by its community

Every lesson, project, and tool on HelloC++ is funded by sponsors. Join them and help shape what we build next.

Become a Patron