Programming Course for Beginners - ZedLX

The Easiest Online Computer Programming Course, for Free

The Type int [7/14]

Most loop control variables are of type int, since a for loop commonly counts the number of iterations. A count is always a whole number.

A for loop can automatically infer the type of control variable. In this example, the variable i is of type int.

Type int has a getter .roman.

Type num does not have a getter .roman because Roman system has no way of writing non-whole numbers.

Loading...