CyberSlug Rules!

Beginner Programming CMPS060

Prof. Paulo Franca

Home

Syllabus

Login

Objects

Download

Staff only

Integers

what are they?
numbers that do not have a fractional part
  • number of students in class;
  • how many times you do something.
how do we use them in programs?
declare a variable of either type int or long
  • int - can accommodate from -32768 to +32767
  • long - can accommodate a higher range (9 digits)
no warning if overflow!
if you store a number that does not fit, result is unpredictable!
int k = 20000+20000; ---> ???
unsigned
examples