#include<stdio.h>
int main()
{
int a=0;
while(a<a+1)
{
a++;
}
printf("有符号基本整型的最大值是:%d\n\n",a);
printf("有符号基本整型最大值+1的结果是:%d\n\n",a+1);
int b=0;
while(b>b-1)
{
b--;
}
printf("有符号基本整型的最小值是:%d\n\n",b);
printf("有符号基本整型最小值-1的结果是:%d\n\n",b-1);
unsigned c=0;
while (c<c+1)
{
c++;
}
printf("无符号整型的最大值是:%u\n\n",c);
printf("无符号整型最大值+1的结果是:%u\n\n",c+1);
}
#include<stdio.h>
int main()
{
short a=0;
while (a<short(a+1))
{
a++;
}
printf("有符号短整型的最大值是:%hd\n\n",a);
printf("有符号短整型最大值+1的结果是:%hd\n\n",a+1);
short b=0;
while (b>short(b-1))
{
b--;
}
printf("有符号短整型的最小值是:%hd\n\n",b);
printf("有符号短整型最小值-1的结果是:%hd\n\n",b-1);
}
#include<stdio.h>
int main()
{
short a=0,b=1;
while (a<b)
{
a++;
b++;
}
printf("有符号短整型的最大值:%hd\n\n",a);
printf("有符号短整型的最大值+1的结果:%hd\n\n",a+1);
short c=0,d=-1;
while (d<c)
{
c++;
d++;
}
printf("有符号短整型的最小值:%hd\n\n",c);
printf("有符号短整型的最小值-1的结果:%hd\n\n",c-1);
}
标签:int,最小值,数值,C语言,while,整型,printf,main From: https://www.cnblogs.com/xiaosongshu2023/p/17848113.html