下列说法中正确的是()。
A. C语言程序总是从第一个定义的函数开始执行
B. 在C语言程序中要调用的函数必须在main()函数中定义
C. C语言程序总是从main()函数开始执行
D. C语言程序中的main()函数必须在程序的开始部分
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4920-c089-2897e0346500.html
点击查看答案
下列程序的输出结果是()。
main()
{ double d=3.2; int x,y;
x=1.2; y=(x+3.8)/5.0;
printf("%d \n", d*y);
}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4920-c089-2897e0346507.html
点击查看答案
有以下程序
#include "stdio.h"
void main()
{ char s[12]= "a book";
printf("%.4s",s);
}
执行后的输出结果是( )。
A. a book!
B. a book![四个空格]
C. a bo
D. 格式描述错误,输出不确定
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e034650b.html
点击查看答案
有以下程序
#include "stdio.h"
#include
void main()
{ float x,y,z;
scanf("%f,%f",&x,&y);
z=x/y;
while(1)
{ if(fabs(z)>1.0)
{ x=y;
y=z;
z=x/y;
}
else break;
}
printf("%f\n",y);
}
通过键盘输入3.6,2.4,执行后的输出结果是( )。
A. 1.5
B. 1.6
C. 2
D. 2.4
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e0346506.html
点击查看答案
有以下程序
#include
void ive(x,n)
int x[],n;
{ int t,*p;
p=x+n-1;
while(x{ t=*x;
*x++=*p;
*p--=t;
}
return;
}
void main()
{ int i,a[]={1,2,3,4,5,6,7,8,9,0};
ive(a,10);
for(i=0;i<10;i++)
printf("%d ",a[i]);
printf("\n");
}
执行后的输出结果是( )。
A. 1 2 3 4 5 6 7 8 9 0
B. 0 9 8 7 6 5 4 3 2 1
C. 1 3 5 7 9 2 4 6 8 0
D. 0 8 6 4 2 9 7 5 3 1
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e034651e.html
点击查看答案
#include
void disp(char *string)
{
if(*string)
{
disp( string+1);
putchar (*string);
}
}
void main()
{
disp("abcdefg");
}
程序的运行结果是( )。
A. abcdefg
B. gfedcba
C. abcd
D. dcba
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346506.html
点击查看答案
已知字符0的ASCII码为十六进制的30,下面程序的输出是()。
main()
{ union { unsigned char c;
unsigned int i[4];
} z;
z.i[0]=0x39;
z.i[1]=0x36;
printf("%c\n",z.c);}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e0346504.html
点击查看答案
下列程序段执行后,s的值是( )
static char ch[]="600";
int a,s=0;
for(a=0;ch[a]>='0'&&ch[a]<='9';a++)
s=10*s+ch[a]-'0';
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e034650b.html
点击查看答案
以下叙述中错误的是()。
A. C程序中的#include和#define行均不是C语句
B. 除逗号运算符外,赋值运算符的优先级最低
C. C程序中,j++;是赋值语句
D. C程序中,+、-、*、/、%号是算术运算符,可用于整型和实型数的运算
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346504.html
点击查看答案
执行下列程序时输入123<空格>456<空格>789<回车> 输出结果是 ()。
main()
{ char s[100]; int c, i;
scanf("%c",&c); scanf("%d",&i); scanf("%s",s);
printf("%c,%d,%s\n",c,i,s);
}
A. 123456789
B. 1456789
C. 1,23,456,789
D. 1,23,456
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346522.html
点击查看答案