填空题

以下程序的输出结果是______。 #include<stdio.h> main() {int i=10,j=0; do {j=j+i; i--; }while(i>5); printf("%d\n",j); }

【参考答案】

40
<上一题 目录 下一题>
热门 试题

填空题
下列程序的功能是:求出ss所指字符串中指定字符的个数,并返回此值。 例如,若输入字符串123412132,输入字符1,则输出3,请填空。 #include<conio.h> #include<stdio.h> #define M 81 int fun(char*ss,char c) {int i=0; for(;______;ss++) if(*ss==c)i++; return i;} main() {char a[M],ch; printf( nPlease enter a string: );gets(a); printf( nPlease enter a char: );ch=getchar(); printf( nThe number of the char is:%d n ,fun(a,ch));}
填空题
以下程序是求矩阵a、b的和,结果存入矩阵c中,请填空。 #include<stdio.h> main() {int a[4][4]={1,2,6,7},{0,4,2,-8},{1,4,5,2},{2,4,6,8}}; int b[4][4]={{-4,0,7,9},{2,-7,7,4),{6,9,0,1),{8,8,6,5)}; int i,j,c[4][4]; for(i=0;i<4;i++) for(j=0;j<4;j++) c[i][j]=______; for(i=0;i<4;i++) for(j=0;j<4;j++) printf( %d ,c[i][j]); }
相关试题
  • C语言中规定,程序中各函数之间()。
  • 若有代数式,(其中P仅代表自然对数的底数...
  • 以下( )不属于对象的基本特征。
  • 有以下程序: #include<stdio.h> int...
  • 有以下程序段 char ch;int k; ch='a...