Integer

From ElectronicWar

Jump to: navigation, search

An integer is a nonfractional number that contains the negative number line, positive number line, and zero. For the rest of the real numbers, see Float. Integers, as with other variables, are defined by naming the type, and then giving the variable a name. After the variable has been defined, it can either be initialised on the same line, or further on in the code.

[edit] Examples

int int_name = value;
int sidesOfSquare = 23;
int sidesOfSquare; 
sidesOfSquare= 23;
int sidesOfSquare = 23;
int perimeter =  sidesOfSquare * 4;
int perimeter =  23 * 4;
Personal tools