下面的程序段企图将下标值赋给数组的每个元素,其中在下标操作上有一些错误,请指出这些错误。const size_t array_size=10;int ialarray_size];for(sizet ix-1;ix <=array_size;++ix)ia[ix]=ix;
举一反三
- 下面程序的运行结果是 iX=80,iY=25____。void main(){ int iX,iY;iX=80;iY=25;printf("iX=%d,iY=%d\n",iX,iY);printf("iX/iY=%d,iX%iY=%d\n",iX/iY,iX%iY);}
- 下面程序的输出结果是________ #include "stdio.h" main() {int iX=3; switch(iX) { case 1: case 2: printf("iX<3 "); case 3: printf("iX=3 "); case 4: case 5: printf("iX>3 "); default: printf("iX unknow "); } }
- void main() { int iX,iY,iM,iN; iX=10;iY=20; iM=iX++;iN=++iY; printf("iX=%d,iY=%d,iM=%d,iN=%d",iX,iY,iM,iN); iM=iX– –;iN=– –iY; printf("iX=%d,iY=%d,iM=%d,iN=%d",iX,iY,iM,iN); }
- #include "stdio.h" void main() { int iX,iY,iM,iN; iX=10;iY=20; iM=iX++;iN=iY++; printf("iX=%d,iY=%d,iM=%d,iN=%d",iX,iY,iM,iN); iM=iX--;iN=--iY; printf("iX=%d,iY=%d,iM=%d,iN=%d",iX,iY,iM,iN); }
- 下面程序的输出结果是[br][/br] iX=3[br][/br] iX>3[br][/br]____ 。[br][/br]#include "stdio.h"[br][/br]main()[br][/br]{int iX=3;[br][/br] switch(iX)[br][/br] { case 1:[br][/br] case 2: printf("iX[3\n");<br] case 3: printf("iX=3\n");[br][/br] case 4:[br][/br] case 5: printf("iX>3\n");[br][/br] default: printf("iX unknow\n");[br][/br] }[br][/br]}