以下程序的输出结果是()。
func(int a,int b)
{ int c;
c=a+b;
return c;}
main( )
{ int x=6,y=7,z=8,r=0;
r=func((x--,y++,x+y),z--);
printf(“%d\n”,r);}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346500.html
点击查看答案
以下正确的描述是()。
A. continue语句的作用是结束整个循环的执行
B. 只能在循环体内和switch语句体内使用break语句
C. 在循环体内使用break语句或continue语句的作用相同
D. 从多层循环嵌套中退出时, 只能使用goto语句
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e034650f.html
点击查看答案
下面的程序执行后,文件test中的内容是 ()。
void fun(char *fname,char *st)
{ FILE *myf; int i;
myf=fopen(fname,"w" );
for(i=0;st[i];i++)
fputc(st[i],myf);
fputc('\0',myf);
fclose(myf);
}
main()
{ fun("test","new world"); fun("test","hello,");}
A. hello,
B. new worldhello,
C. new world
D. hello, rld
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e034650e.html
点击查看答案
有以下程序
#include
void main()
{ int b[3] [3]={0,1,2,0,1,2,0,1,2},i,j,t=1;
for(i=0; i<3; i++)
for(j=i;j<=i;j++) t+=b[i][b[j][i]];
printf("%d\n",t);
}
执行后的输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346516.html
点击查看答案
下列程序执行后的输出结果是( )。 #include "stdio.h"
void main()
{
int i;
for(i=1;i+1;i++)
{
if(i>4)
{ printf("%d\n",i);
break;
}
printf("%d\n",i++);
}
}
A. 1 3 5
B. 1
3
5
C. 1
2
3
D. 1
2
4
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346503.html
点击查看答案
运行结果是( )
switch ( ‘B’ )
{case ‘A’:printf("abc");break;
case ‘B’:switch(1)
{case 0:printf("a");break;
case 1;printf("b");break;
default:printf("c");break;
}
default:printf("x");
}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e0346512.html
点击查看答案
以下不合法的用户标识符是()。
A. j2_KEY
B. Double
C. 4d
D. _8_
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e034651a.html
点击查看答案
有以下程序
struct stu
{ int num;
char name[10];
int age;
};
void fun(struct stu *p)
{ printf("%s\n",(*p).name); }
main()
{
struct stu students[3]={{9801,"Zhang",20},
{9802,"Wang",19},
{9803,"Zhao",18} };
fun(students+2);
}
输出结果是()。
A. Zhang
B. Zhao
C. Wang
D. 18
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346505.html
点击查看答案
设整型变量a为5,使b不为2的表达式是( )。
A. b=a/2
B. b=6-(--a)
C. b=a%2
D. b=a>3?2:1
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e034651b.html
点击查看答案
有以下程序
#include "stdio.h"
f(char *s)
{ char *p=s;
while(*p!='\0')
p++;
return(p-s);
}
void main()
{ printf("%d\n",f("ABCDEF"));
}
执行后的输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346512.html
点击查看答案