previous | start | next

Overflow

    1   #include <stdio.h>
    2   #include <stdlib.h>
    3   
    4   
    5   
    6   int main()
    7   {
    8     unsigned char x, y;
    9     unsigned char z;
   10     x = 250;
   11     y = 16;
   12     z = x + y;
   13   
   14     printf("%u + %u  = %u\n", x, y, z);
   15   
   16     return 0;
   17     
   18   }

Output:
 250 + 16 = 10

Notes:
The %u is a conversion specification to output z 
as an unsigned integer. 




previous | start | next