试题通
试题通
APP下载
首页
>
IT互联网
>
信息技术知识竞赛c语言
试题通
搜索
信息技术知识竞赛c语言
题目内容
(
单选题
)
假定int类型变量占用两个字节,其有定义:int x[10]={0,2,4};,则数组x在内存中所占字节数是()。

A、3

B、6

C、10

D、20

答案:D

试题通
信息技术知识竞赛c语言
试题通
以下不正确的描述为()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346506.html
点击查看题目
以下程序运行后的输出结果是( ) 。
#include
main()
{int a=37;
a%=9; printf(“%d\n”,a);
}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346517.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
点击查看题目
C语言中规定函数的返回值的类型是由( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346512.html
点击查看题目
有以下程序
void fun1(char *p)
{char *q;
q=p;
while(*q!='\0')
{ (*q)++; q++;
}
main()
{char a[]={"Program"}, *p;
p=&a[3];fun1(p);printf("%s\n",a);
}
程序执行后的输出
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346515.html
点击查看题目
有以下程序
#include
struct tt
{int x;struct tt *y;} *p;
struct tt a[4]={20,a+1,15,a+2,30,a+3,17,a};
void main()
{
int i;
p=a;
for(i=1;i<=2;i++)
{printf("%d,",p->x); p=p->y;}
}
执行后的输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e0346502.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
点击查看题目
有以下程序
  #include
  void main()
  { int s;
  scanf("%d",&s);
  while(s>0)
  { switch(s)
  { case 1:printf("%d",s+5);
  case 2:printf("%d",s+4); break;
  case 3:printf("%d",s+3);
  default:printf("%d",s+1);break;
  }
  scanf("%d",&s);
  }
  }
  运行时,若输入1 2 3 4 5 0<回车>,则输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e034650b.html
点击查看题目
设有以下定义,值为5的枚举常量是( )。
enum week{sun,mon=4,tue,wed,thu,fri,sat} w;
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e0346514.html
点击查看题目
有以下程序
#include
# include
char *fun(char *t)
{
char *p=t;
return(p+strlen(t)/2);
}
void main()
{
char *str="abcdefgh";
str=fun(str);
puts(str);
}
执行后的输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e0346500.html
点击查看题目
首页
>
IT互联网
>
信息技术知识竞赛c语言
题目内容
(
单选题
)
手机预览
试题通
信息技术知识竞赛c语言

假定int类型变量占用两个字节,其有定义:int x[10]={0,2,4};,则数组x在内存中所占字节数是()。

A、3

B、6

C、10

D、20

答案:D

试题通
试题通
信息技术知识竞赛c语言
相关题目
以下不正确的描述为()。

A. 不同函数中可以使用相同名字的变量

B. 形参是局部变量

C. 一个函数内部定义的变量只能在本函数范围内有效

D. 在一个内部的复合语句中定义的变量可以在本函数范围内有效

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346506.html
点击查看答案
以下程序运行后的输出结果是( ) 。
#include
main()
{int a=37;
a%=9; printf(“%d\n”,a);
}

A. 0

B. 1

C. 2

D. 3

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346517.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
点击查看答案
C语言中规定函数的返回值的类型是由( )。

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

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

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

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

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346512.html
点击查看答案
有以下程序
void fun1(char *p)
{char *q;
q=p;
while(*q!='\0')
{ (*q)++; q++;
}
main()
{char a[]={"Program"}, *p;
p=&a[3];fun1(p);printf("%s\n",a);
}
程序执行后的输出

A. Prohsbn

B. Prphsbn

C. Progsbn

D. Program

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346515.html
点击查看答案
有以下程序
#include
struct tt
{int x;struct tt *y;} *p;
struct tt a[4]={20,a+1,15,a+2,30,a+3,17,a};
void main()
{
int i;
p=a;
for(i=1;i<=2;i++)
{printf("%d,",p->x); p=p->y;}
}
执行后的输出结果是( )。

A. 20,15,

B. 20,14,

C. 28,13,

D. 15,20,

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e0346502.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 main()
  { int s;
  scanf("%d",&s);
  while(s>0)
  { switch(s)
  { case 1:printf("%d",s+5);
  case 2:printf("%d",s+4); break;
  case 3:printf("%d",s+3);
  default:printf("%d",s+1);break;
  }
  scanf("%d",&s);
  }
  }
  运行时,若输入1 2 3 4 5 0<回车>,则输出结果是( )。

A. 6566456

B. 66656

C. 66666

D. 6666656

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e034650b.html
点击查看答案
设有以下定义,值为5的枚举常量是( )。
enum week{sun,mon=4,tue,wed,thu,fri,sat} w;

A. tue

B. sat

C. fri

D. thu

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e0346514.html
点击查看答案
有以下程序
#include
# include
char *fun(char *t)
{
char *p=t;
return(p+strlen(t)/2);
}
void main()
{
char *str="abcdefgh";
str=fun(str);
puts(str);
}
执行后的输出结果是( )。

A. efgh

B. abcd

C. bcde

D. cdef

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