APP下载
首页
>
IT互联网
>
信息技术知识竞赛c语言
搜索
信息技术知识竞赛c语言
题目内容
(
单选题
)
有以下程序
#include
void num()
{ extern int x,y;
int a=15,b=10;
x=a-b;
y=a+b;
}
int x,y;
main()
{ int a=7,b=5;
x=a-b;
y=a+b;
num();
printf("%d,%d\n",x,y);
}
执行后的输出结果是( )。

A、12,2

B、 5,25

C、 1,12

D、输出不确定

答案:B

信息技术知识竞赛c语言
下列程序执行后的输出结果是()。
main()
{ char x=0xFFFF; printf("%d \n",x--); }
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e034650b.html
点击查看题目
若int类型占两个字节,则以下语句输出为()。
int k=-1;
printf("%d,%u\n",k,k);
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346516.html
点击查看题目
下列标识符中不合法的是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346500.html
点击查看题目
以下叙述不正确的是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e034651d.html
点击查看题目
有以下程序
#include "stdio.h"
void main()
{ union
{ int i[2];
long k;
char c[4];
}r,*s=&r;
s->i[0]=0x39;
s->i[1]=0x38;
printf("%c\n",s->c[0]);
}
执行后的输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e0346504.html
点击查看题目
若x为int型变量,则以下函数fun的类型为( )。
fun(x)
{ printf(“%d\n”,x);}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346510.html
点击查看题目
以下程序的输出结果是()。
long fun( int n)
{ long s;
if(n==1||n==2)s=2;
else s=n-fun(n-1);
return s;}
main()
{ printf("%ld\n", fun(3)); }
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e034650b.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
点击查看题目
x,y,z被定义为int型变量,若从键盘给x,y,z输入数据,正确的输入语句是 ()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346521.html
点击查看题目
设ch是char型变量,其值为A,且有下面的表达式:
ch=(ch>='A'&&ch<='Z')?(ch+32):ch 的值是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e0346512.html
点击查看题目
首页
>
IT互联网
>
信息技术知识竞赛c语言
题目内容
(
单选题
)
手机预览
信息技术知识竞赛c语言

有以下程序
#include
void num()
{ extern int x,y;
int a=15,b=10;
x=a-b;
y=a+b;
}
int x,y;
main()
{ int a=7,b=5;
x=a-b;
y=a+b;
num();
printf("%d,%d\n",x,y);
}
执行后的输出结果是( )。

A、12,2

B、 5,25

C、 1,12

D、输出不确定

答案:B

信息技术知识竞赛c语言
相关题目
下列程序执行后的输出结果是()。
main()
{ char x=0xFFFF; printf("%d \n",x--); }

A. -32767

B. FFFE

C. -1

D. -32768

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e034650b.html
点击查看答案
若int类型占两个字节,则以下语句输出为()。
int k=-1;
printf("%d,%u\n",k,k);

A. -1,-1

B. -1,65536

C. -1,32768

D. -1,65535

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346516.html
点击查看答案
下列标识符中不合法的是()。

A. s_name

B. _e

C. fox

D. 3DS

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346500.html
点击查看答案
以下叙述不正确的是()。

A. 一个C源程序可由一个或多个函数组成

B. 一个C源程序必须包含一个main函数

C. C程序的基本组成单位是函数

D. 在C程序中,注释说明只能位于一条语句的后面

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e034651d.html
点击查看答案
有以下程序
#include "stdio.h"
void main()
{ union
{ int i[2];
long k;
char c[4];
}r,*s=&r;
s->i[0]=0x39;
s->i[1]=0x38;
printf("%c\n",s->c[0]);
}
执行后的输出结果是( )。

A. 39

B. 9

C. 38

D. 8

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e0346504.html
点击查看答案
若x为int型变量,则以下函数fun的类型为( )。
fun(x)
{ printf(“%d\n”,x);}

A. 返回值为void类型

B. 无法确定返回值

C. 返回值为int类型

D. 无返回值

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346510.html
点击查看答案
以下程序的输出结果是()。
long fun( int n)
{ long s;
if(n==1||n==2)s=2;
else s=n-fun(n-1);
return s;}
main()
{ printf("%ld\n", fun(3)); }

A. 1

B. 2

C. 3

D. 4

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e034650b.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");
}

A. ax

B. bx

C. cx

D. dx

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e0346512.html
点击查看答案
x,y,z被定义为int型变量,若从键盘给x,y,z输入数据,正确的输入语句是 ()。

A. INPUT x,y,z;

B. scanf("%d%d%d",&x,&y,&z);

C. scanf("%d%d%d",x,y,z);

D. read("%d%d%d",&x,&y,&z);

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346521.html
点击查看答案
设ch是char型变量,其值为A,且有下面的表达式:
ch=(ch>='A'&&ch<='Z')?(ch+32):ch 的值是()。

A. A

B. a

C. Z

D. z

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