Programming Course for Beginners - ZedLX

The Easiest Online Computer Programming Course, for Free

Count and Sum [6/8]

This program calculates the sum of squares of the first 9 natural numbers.

Important:
a variable introduced inside a statement block gets removed when the statement block has completed the execution.
In this example, the variable x, which is introduced inside a statement block, is not available outside the statement block. The loop control variable i is also not available outside the loop.

Loading...