有以下程序
#include
int fun (int x,int y)
{ if (x!=y) return ((x+y)/2);
else return (x);
}
main()
{ int a=4,b=5,c=6;
printf("%d\n",fun(2*a,fun(b,c)));
}
程序运行后的输出结果是 ()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e0346523.html
点击查看答案
以下程序的输出结果是()。
struct HAR
{ int x, y; struct HAR *p;
} h[2];
main()
{h[0].x=1;
h[0].y=2;
h[1].x=3;
h[1].y=4;
h[1].p=&h[1];
h[1].p=h;
printf("%d %d \n",(h[0].p)->x,(h[1].p)->y);
}
A. 1 2
B. 2 3
C. 1 4
D. 3 2
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e0346502.html
点击查看答案
以下语句中存在语法错误的是()。
A. char ss[6][20];ss[1]= "right? ";
B. char ss[][20]={ "right? "};
C. char *ss[6];ss[1]= "right? ";
D. char *ss[]={"right? "};
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e034650a.html
点击查看答案
有以下程序
#include
void fun(int *s)
{ static int j=0;
do
{ s[j]+=s[j+1];
}while(++j<2);
}
void main()
{ int k,a[10]={1,2,3,4,5};
for(k=1;k<3;k++)
fun(a);
for(k=0;k<5;k++)
printf("%d",a[k]);
}
执行后的输出结果是( )。
A. 35756
B. 23445
C. 35745
D. 12345
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346518.html
点击查看答案
以下程序运行后的输出结果是() 。
#include
main()
{ int x=10,y=20,t=0;
if(x==y)t=x;x=y;y=t;
printf("%d %d\n",x,y);
}
A. 10 0
B. 20 0
C. 10 20
D. 20 10
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346508.html
点击查看答案
阅读下列程序:
main( )
{ int n[3],i,j,k;
for(i=0;i〈3;i++〉 n[i]=0;
k=2;
for (i=0;i〈k;i++〉
for (j=0;j〈k;j++〉 n[j]=n[i]+1;
printf("%d\n",n[1]); }
程序运行后输出结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e0346518.html
点击查看答案
表达式:10!=9的值是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346519.html
点击查看答案
以下正确的描述是()。
A. continue语句的作用是结束整个循环的执行
B. 只能在循环体内和switch语句体内使用break语句
C. 在循环体内使用break语句或continue语句的作用相同
D. 从多层循环嵌套中退出时, 只能使用goto语句
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e034650f.html
点击查看答案
#include "stdio.h"
int digits(int n)
{
int c=0;
do {
c++;
n/=10;
}while(n);
return c;
}
void main( )
{
printf("%d",digits(824));
}
程序运行结果是 ( ) 。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346507.html
点击查看答案
有语句char str1[10],str2[10]={"china"};则能将字符串china赋给数组str1的正确语句是( )。
A. str1={"china"};
B. strcpy(str1,str2);
C. str1=str2;
D. strcpy(str2,str1);
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e034651d.html
点击查看答案