Answers for "signed and unsigned in c"

C
0

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;
Posted by: Guest on March-01-2022

Code answers related to "C"

Browse Popular Code Answers by Language