#include<stdio.h>
/*用程序求出int 的取值范围*/
int main()
{
int max = 0, i, temp = 1;
printf("%dn",sizeof(int));
for(i = sizeof(int)*8-2; i>=0; i--)
{
for(int j = i; j >0; j--)
{
temp *= 2;
}
max += temp;
temp = 1;
}
printf("min = %d, max = %dn",max+1,max);
return 0;
}
最后
以上就是老迟到水池最近收集整理的关于用程序求出int 的取值范围的全部内容,更多相关用程序求出int内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复