类型说明符 数的范围 分配字节数 int -32768~32767 ■■ short int -32768~32767 ■■ signed int -32768~32767 ■■ unsigned int 0~65535 ■■ long int -2147483648~2147483647 ■■■■ unsigned long 0~4294967295 ■■■■
整型变量的说明
变量说明的一般形式为: 类型说明符 变量名标识符,变量名标识符,...; 例如:
int a,b,c; (a,b,c为整型变量) long x,y; (x,y为长整型变量) unsigned p,q; (p,q为无符号整型变量)
[PRactice] //1int a,b; short int c; short d=100; a=d-20; b=a+d; c=a+b+d; d=d-a+c-b;'Vtable a,2,0 b,2,0 c,2,0 d,2,100 of Vtable 'Vupdate 1,0;2,0 3,0 4,100 1,80 2,180 3,360 4,200 of Vupdate of Practice [Practice] //2int a=5; int b=9; long int c; long d; c=a+b-7; d=a*b*c; c=d*d*d; a=c-d;'Vtable a,2,5 b,2,9 c,4,0 d,4,0 of Vtable 'Vupdate 1,5 2,9 3,0 4,0 3,7 4,315 3,31255875 1,-5112 of Vupdate of Practice [Practice] //3int a=6,b=19; unsigned int c; int d; c=a-b+7; d=b*c; a=b+c+d; b=-a;'Vtable a,2,6 b,2,19 c,2,0 d,2,0 of Vtable 'Vupdate 1,6;2,19 3,0 4,0 3,65530 4,-114 1,-101 2,101 of Vupdate of Practice void main(){ long x,y; int a,b,c,d; x=5; y=6; a=7; b=8; c=x+a; d=y+b; printf("c=x+a=%d,d=y+b=%d/n",c,d); }