Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - C language data type problem
C language data type problem
There are two reasons:

1.(a+b & gt; 6)?

Because when the compiler encounters unsigned int and int calculation, your calculation will be automatically converted into unsigned int.

A+b will be an unsigned plastic number, a+b >; 6 will return the true value and print f ("> 6")

2.printf("\n%d ",a+b);

Because the print format symbol is %d, the output is plastic.

The following format is for your reference.

%d output is an integer, %ld output is a long integer, %hd output is a short integer, %u output is an unsigned integer, %lu output is an unsigned long integer, and %hu output is an unsigned short integer.