Professional Documents
Culture Documents
Integers
Numbers without fractional parts
3, 47, -12
Variables can be used to store integers using
an assignment statement
int daysInWeek;
daysInWeek = 7;
Reading Integers
import CSLib.*;
Inputbox in;
int i;
in = newInputBox();
in.setPrompt(Enter an integer: );
i = in.readInt();
Operation
Example
Addition
45 + 5 = 50
Subtraction
657 57 = 600
Division
10 / 3 = 3
Remainder
10 % 3 = 1