Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

signed and unsigned in c

// valid codes
//In C, signed and unsigned are type modifiers. You can alter the data storage of a data type by using them:

//signed - allows for storage of both positive and negative numbers
//unsigned - allows for storage of only positive numbers
unsigned int x = 35;
int y = -35;  // signed int
int z = 36;  // signed int

// invalid code: unsigned int cannot hold negative integers
unsigned int num = -35;
Source by www.programiz.com #
 
PREVIOUS NEXT
Tagged: #signed #unsigned
ADD COMMENT
Topic
Name
3+2 =