APP下载
首页
>
IT互联网
>
信息技术知识竞赛c语言
搜索
信息技术知识竞赛c语言
题目内容
(
单选题
)
有以下程序
#include
#include
void fun(char *w,int m)
{char s,*p1,*p2;
p1=w;p2=w+m-1;
while(p1}
main()
{char a[]=”123456”;
fun(a,strlen(a)); puts(a);
}
程序运行后的输出结果是( )。

A、654321

B、116611

C、161616

D、123456

答案:A

信息技术知识竞赛c语言
以下程序输出结果是 。
#include "stdio.h"
void f ();
main()
{int a;
for(a=1;a<=3;a++)
fun();
}
void fun()
{static int i=1;
i+=3;
printf("%2d",i);
}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e0346513.html
点击查看题目
假定int类型变量占用两个字节,其有定义:int x[10]={0,2,4};,则数组x在内存中所占字节数是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346514.html
点击查看题目
下列说法中正确的是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4920-c089-2897e0346500.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
点击查看题目
以下程序的输出结果是( )。
main()
{ int a, b;
for(a=1, b=1; a<=100; a++)
{ if(b>=10) break;
if (b%3= =1)
{ b+=3; continue; }
}
printf("%d\n",a);
}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e0346524.html
点击查看题目
下面有关for循环的正确描述是 ()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346523.html
点击查看题目
下面程序的输出结果是 ( )。
main()
{ int a[10]={1,2,3,4,5,6,7,8,9,10},*p=a;
printf("%d\n",*(p+2));}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346521.html
点击查看题目
有以下程序
#include
double f(double x);
main()
{double a=0; int i;
for(i=0;i<30;i+=10) a+=f((double)i);
printf(“%5.0f\n”,a);
}
double f(double x)
{return x*x+1;}
程序运行后的输出结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e034650e.html
点击查看题目
在“文件包含”预处理语句的使用形式中,当#include后面的文件用了“”(双引号)
时,寻找被包含文件的方式是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-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
点击查看题目
首页
>
IT互联网
>
信息技术知识竞赛c语言
题目内容
(
单选题
)
手机预览
信息技术知识竞赛c语言

有以下程序
#include
#include
void fun(char *w,int m)
{char s,*p1,*p2;
p1=w;p2=w+m-1;
while(p1}
main()
{char a[]=”123456”;
fun(a,strlen(a)); puts(a);
}
程序运行后的输出结果是( )。

A、654321

B、116611

C、161616

D、123456

答案:A

信息技术知识竞赛c语言
相关题目
以下程序输出结果是 。
#include "stdio.h"
void f ();
main()
{int a;
for(a=1;a<=3;a++)
fun();
}
void fun()
{static int i=1;
i+=3;
printf("%2d",i);
}

A. 4 7 10

B. 4 4 4

C. 4 5 6

D. 4 6 8

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e0346513.html
点击查看答案
假定int类型变量占用两个字节,其有定义:int x[10]={0,2,4};,则数组x在内存中所占字节数是()。

A. 3

B. 6

C. 10

D. 20

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346514.html
点击查看答案
下列说法中正确的是()。

A. C语言程序总是从第一个定义的函数开始执行

B. 在C语言程序中要调用的函数必须在main()函数中定义

C. C语言程序总是从main()函数开始执行

D. C语言程序中的main()函数必须在程序的开始部分

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4920-c089-2897e0346500.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
点击查看答案
以下程序的输出结果是( )。
main()
{ int a, b;
for(a=1, b=1; a<=100; a++)
{ if(b>=10) break;
if (b%3= =1)
{ b+=3; continue; }
}
printf("%d\n",a);
}

A. 101

B. 6

C. 5

D. 4

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e0346524.html
点击查看答案
下面有关for循环的正确描述是 ()。

A. for循环只能用于循环次数已经确定的情况

B. for循环是先执行循环体语句,后判断表达式

C. 在for循环中,不能用break语句跳出循环体

D. for循环的循环体语句中,可以包含多条语句,但必须用花括号括起来

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346523.html
点击查看答案
下面程序的输出结果是 ( )。
main()
{ int a[10]={1,2,3,4,5,6,7,8,9,10},*p=a;
printf("%d\n",*(p+2));}

A. 3

B. 4

C. 1

D. 2

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346521.html
点击查看答案
有以下程序
#include
double f(double x);
main()
{double a=0; int i;
for(i=0;i<30;i+=10) a+=f((double)i);
printf(“%5.0f\n”,a);
}
double f(double x)
{return x*x+1;}
程序运行后的输出结果是()。

A. 503

B. 401

C. 500

D. 1404

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e034650e.html
点击查看答案
在“文件包含”预处理语句的使用形式中,当#include后面的文件用了“”(双引号)
时,寻找被包含文件的方式是()。

A. 直接按系统设定的标准方式搜索目录

B. 先在源程序所在目录搜索,再按系统设定的标准方式搜索

C. 仅仅搜索源程序所在目录

D. 仅仅搜索当前目录

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-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
点击查看答案
试题通小程序
试题通app下载