首页 > 其他分享 > (笔试题)这段代码输出啥

(笔试题)这段代码输出啥

时间:2023-02-08 17:06:17浏览次数:42  
标签:输出 11111111111111111111111110000000 return 代码 笔试 char includeint printf main

#include<stdio.h>
int main()
{
char a=-128;
printf("%u\n",a);
return 0;
}

注:%u为无符号十进制整数的输出

#include<stdio.h>
int main()
{
char a=-128;
//10000000000000000000000010000000
//11111111111111111111111101111111
//11111111111111111111111110000000
//char 10000000
//整型提升
//11111111111111111111111110000000-仍是补码
//由于要打印%u,则这也是原码
//11111111111111111111111110000000
printf("%u\n",a);
return 0;
}

输出:

 (笔试题)这段代码输出啥_补码


标签:输出,11111111111111111111111110000000,return,代码,笔试,char,includeint,printf,main
From: https://blog.51cto.com/u_15899086/6044627

相关文章