previous | start | next

Overflow

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

Output:
0

Notes:
The %u is a conversion specification to convert z to string
representation of an unsigned integer. 




previous | start | next