CyberSlug Rules!

Beginner Programming CMPS060

Prof. Paulo Franca

Home

Syllabus

Login

Objects

Download

Staff only

unsigned

what is it?
an unsigned integer can accommodate twice as much positive values (no negative values)
how do we do it?
just precede the declaration with the keyword unsigned
when do we use that?
  • variables that will not take negative values;
  • use with int or long
examples:
unsigned int students, color;
unsigned long social_security, id_number,phone;