试题通
试题通
APP下载
首页
>
IT互联网
>
信息技术知识竞赛c语言
试题通
搜索
信息技术知识竞赛c语言
题目内容
(
单选题
)
22.设有以下程序段
int x=0,s=0;
while(!x!=0)s+=++x;
printf("%d",s);
则()。

A、运行程序段后输出0

B、运行程序段后输出1

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

D、程序段执行无限次

答案:B

试题通
信息技术知识竞赛c语言
试题通
有以下程序
#include
void fun(int *p)
{printf(“%d\n”,p[5]);}
main()
{int a[10]={1,2,3,4,5,6,7,8,9,10};
fun(&a[3]);
程序运行后的输出结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e034650f.html
点击查看题目
设实型变量为f1、f2、f3、f4的值分别为4,3,2,1整型变量m1、m2
的值为1。表达式“(m1=f1>f2)&&(m2=f3
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4920-c089-2897e034650c.html
点击查看题目
下列语句中,不正确的是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346516.html
点击查看题目
设有如下枚举类型定义:
enum language { Basic=3,Assembly,Ada=100,COBOL,Fortran};
枚举量Fortran的值为()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e034650f.html
点击查看题目
以下程序的输出结果是()。
main()
{ int i,j,x=0;
for(i=0;i<2;i++)
{ x++;
for(j=0;j<3;j++)
{ if(j%2)continue;
x++;
}
x++;
}
printf("x=%d\n",x);
}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346507.html
点击查看题目
有以下程序
#include
void main()
{
int s,i,sum();
for (i=1;i<=10;i++)
s=sum(i);
printf("s=%d\n",s);
}
sum(int k)
{
int x=0;
return (x+=k);
}  
程序运行后的输出结果是 ( )。  
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e034650f.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
点击查看题目
有以下程序(说明:字符0的ASCII码值为48)
  #include
  main()
  { char c1,c2;
  scanf("%d",&c1);
  c2=c1+9;
  printf("%c%c\n",c1,c2);
  }
  若程序运行时从键盘输入48<回车>,则输出结果为( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346507.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);
}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e0346502.html
点击查看题目
以下程序的输出结果是()。
union myun
{ struct
{ int x, y, z; } u;
int k;
} a;
main()
{ a.u.x=4; a.u.y=5; a.u.z=6;
a.k=0;
printf("%d\n",a.u.x);}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e034650d.html
点击查看题目
首页
>
IT互联网
>
信息技术知识竞赛c语言
题目内容
(
单选题
)
手机预览
试题通
信息技术知识竞赛c语言

22.设有以下程序段
int x=0,s=0;
while(!x!=0)s+=++x;
printf("%d",s);
则()。

A、运行程序段后输出0

B、运行程序段后输出1

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

D、程序段执行无限次

答案:B

试题通
试题通
信息技术知识竞赛c语言
相关题目
有以下程序
#include
void fun(int *p)
{printf(“%d\n”,p[5]);}
main()
{int a[10]={1,2,3,4,5,6,7,8,9,10};
fun(&a[3]);
程序运行后的输出结果是()。

A. 5

B. 6

C. 8

D. 9

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e034650f.html
点击查看答案
设实型变量为f1、f2、f3、f4的值分别为4,3,2,1整型变量m1、m2
的值为1。表达式“(m1=f1>f2)&&(m2=f3

A. 0

B. 1

C. 2

D. 出错

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4920-c089-2897e034650c.html
点击查看答案
下列语句中,不正确的是( )。

A. static char a[2]={1,2};

B. static char a[2]={ '1', '2'};

C. static char a[2]={ '1', '2', '3'};

D. static char a[2]={ '1'};

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346516.html
点击查看答案
设有如下枚举类型定义:
enum language { Basic=3,Assembly,Ada=100,COBOL,Fortran};
枚举量Fortran的值为()。

A. 4

B. 7

C. 102

D. 103

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e034650f.html
点击查看答案
以下程序的输出结果是()。
main()
{ int i,j,x=0;
for(i=0;i<2;i++)
{ x++;
for(j=0;j<3;j++)
{ if(j%2)continue;
x++;
}
x++;
}
printf("x=%d\n",x);
}

A. x=4

B. x=8

C. x=6

D. x=12

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346507.html
点击查看答案
有以下程序
#include
void main()
{
int s,i,sum();
for (i=1;i<=10;i++)
s=sum(i);
printf("s=%d\n",s);
}
sum(int k)
{
int x=0;
return (x+=k);
}  
程序运行后的输出结果是 ( )。  

A. 55

B. 45

C. 15

D. 10

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e034650f.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
点击查看答案
有以下程序(说明:字符0的ASCII码值为48)
  #include
  main()
  { char c1,c2;
  scanf("%d",&c1);
  c2=c1+9;
  printf("%c%c\n",c1,c2);
  }
  若程序运行时从键盘输入48<回车>,则输出结果为( )。

A. 7

B. 8

C. 9

D. 6

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346507.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
点击查看答案
以下程序的输出结果是()。
union myun
{ struct
{ int x, y, z; } u;
int k;
} a;
main()
{ a.u.x=4; a.u.y=5; a.u.z=6;
a.k=0;
printf("%d\n",a.u.x);}

A. 4

B. 5

C. 6

D. 0

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