APP下载
首页
>
IT互联网
>
信息技术知识竞赛c语言
搜索
信息技术知识竞赛c语言
题目内容
(
单选题
)
阅读下列程序:
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]); }
程序运行后输出结果是()。

A、2

B、1

C、0

D、3

答案:D

信息技术知识竞赛c语言
有以下程序
#include
void fun(char *s)
{ while(*s)
{ if (*s%2==0) printf("%c",*s);
s++;
}
}
void main()
{
char a[]={"good"};
fun(a);
printf("\n");
}
执行后的输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e0346503.html
点击查看题目
若有定义语句:double a,*p=&a;以下叙述中错误的是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e0346504.html
点击查看题目
要使下列程序的输出结果是字符A,则下划线处应填 ( ) 。
main()
{
char x='b';
int i=0;
do{
--x;
}while( _____ );
printf("%c",x);
}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346504.html
点击查看题目
22.设有以下程序段
int x=0,s=0;
while(!x!=0)s+=++x;
printf("%d",s);
则()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346508.html
点击查看题目
#include
void main()
{
char str[]="\"stop!\",he said";
printf(str);
}
程序的运行结果是 ( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e034650a.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,执行后的输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e0346506.html
点击查看题目
以下正确的描述是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e034650f.html
点击查看题目
有以下程序
#include
int f(int m)
{static int n=0;
n+=m;
return n;
}
main()
{int n=0;
printf(“%d,”,f(++n));
printf(“%d\n”,f(n++));
}
程序运行后的输出结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346512.html
点击查看题目
有以下程序
#include "stdio.h"
int abc(int u,intv);
main ()
{ int a=24,b=16,c;
c=abc(a,b);
printf('%d\n",c);
}
int abc(int u,int v)
{ int w;
while(v)
{ w=u%v; u=v; v=w }
return u;
}
输出结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e0346516.html
点击查看题目
C语言中规定函数的返回值的类型是由( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346512.html
点击查看题目
首页
>
IT互联网
>
信息技术知识竞赛c语言
题目内容
(
单选题
)
手机预览
信息技术知识竞赛c语言

阅读下列程序:
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]); }
程序运行后输出结果是()。

A、2

B、1

C、0

D、3

答案:D

信息技术知识竞赛c语言
相关题目
有以下程序
#include
void fun(char *s)
{ while(*s)
{ if (*s%2==0) printf("%c",*s);
s++;
}
}
void main()
{
char a[]={"good"};
fun(a);
printf("\n");
}
执行后的输出结果是( )。

A. a

B. b

C. c

D. d

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e0346503.html
点击查看答案
若有定义语句:double a,*p=&a;以下叙述中错误的是()。

A. 定义语句中的*号是一个间址运算符

B. 定义语句中的*号只是一个说明符

C. 定义语句中的p只能存放double类型变量的地址

D. 定义语句中,*p=&a把变量a的地址作为初值赋给指针变量p

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e0346504.html
点击查看答案
要使下列程序的输出结果是字符A,则下划线处应填 ( ) 。
main()
{
char x='b';
int i=0;
do{
--x;
}while( _____ );
printf("%c",x);
}

A. i++<31

B. i++<32

C. i<31

D. i<32

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346504.html
点击查看答案
22.设有以下程序段
int x=0,s=0;
while(!x!=0)s+=++x;
printf("%d",s);
则()。

A. 运行程序段后输出0

B. 运行程序段后输出1

C. 程序段中的控制表达式是非法的

D. 程序段执行无限次

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346508.html
点击查看答案
#include
void main()
{
char str[]="\"stop!\",he said";
printf(str);
}
程序的运行结果是 ( )。

A. stop!

B. "stop!"

C. "stop",he said

D. he said*/

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e034650a.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
点击查看答案
以下正确的描述是()。

A. continue语句的作用是结束整个循环的执行

B. 只能在循环体内和switch语句体内使用break语句

C. 在循环体内使用break语句或continue语句的作用相同

D. 从多层循环嵌套中退出时, 只能使用goto语句

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e034650f.html
点击查看答案
有以下程序
#include
int f(int m)
{static int n=0;
n+=m;
return n;
}
main()
{int n=0;
printf(“%d,”,f(++n));
printf(“%d\n”,f(n++));
}
程序运行后的输出结果是()。

A. 1,2

B. 1,1

C. 2,3

D. 3,3

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346512.html
点击查看答案
有以下程序
#include "stdio.h"
int abc(int u,intv);
main ()
{ int a=24,b=16,c;
c=abc(a,b);
printf('%d\n",c);
}
int abc(int u,int v)
{ int w;
while(v)
{ w=u%v; u=v; v=w }
return u;
}
输出结果是()。

A. 6

B. 7

C. 8

D. 9

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e0346516.html
点击查看答案
C语言中规定函数的返回值的类型是由( )。

A. return语句中的表达式类型所决定

B. 调用该函数时的主调用函数类型所决定

C. 调用该函数时系统临时决定

D. 在定义该函数时所指定的函数类型所决定

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346512.html
点击查看答案
试题通小程序
试题通app下载