How to output negative numbers in C language?
In the C language, negative numbers can be represented by placing a minus sign “-” in front of the numerical value. To output negative numbers, the printf function can be used with the formatting character “%d” for integers. For example, to output -5, the following code can be used:
int num = -5;
printf("负数:%d", num);
The output results in:
负数:-5