试题通
试题通
APP下载
首页
>
IT互联网
>
信息技术知识竞赛c语言
试题通
搜索
信息技术知识竞赛c语言
题目内容
(
单选题
)
有以下程序
void ss(char *s,char t)
{ while(*s)
{ if(*s==t)*s=t-′a′+′A′;
s++; } }
main()
{ char str1[100]="abcddfefdbd",c=′d′;
ss(str1,c); printf("%s\n",str1);}
程序运行后的输出结果是( )。

A、ABCDDEFEDBD

B、abcDDfefDbD

C、 abcAAfefAbA

D、Abcddfefdbd

答案:B

试题通
信息技术知识竞赛c语言
试题通
若有说明语句:double *p,a;则能通过scanf语句正确给输入项读入数据的程序段是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346528.html
点击查看题目
以下程序运行后的输出结果是 ( ) 。
#include
main()
{int n[2],i,j;
for(i=0;i<2;i++) n[i]=0;
for(i=0;i<2;i++)
for(j=0;j<2;j++) n[j]=n[i]+1;
printf(“%d\n”,n[1]);
}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e034651c.html
点击查看题目
有以下程序
#include
void fun(int *s)
{ static int j=0;
do
{ s[j]+=s[j+1];
}while(++j<2);
}
void main()
{ int k,a[10]={1,2,3,4,5};
for(k=1;k<3;k++)
fun(a);
for(k=0;k<5;k++)
printf("%d",a[k]);
}
执行后的输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346518.html
点击查看题目
在“文件包含”预处理语句的使用形式中,当#include后面的文件用了“”(双引号)
时,寻找被包含文件的方式是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e034650f.html
点击查看题目
设有定义:struct {char mark[12];int num1;double num2;} t1,t2;,若变量均已正确赋初值,则以下语句中错误的是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e0346502.html
点击查看题目
以下不合法的用户标识符是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e034651a.html
点击查看题目
设有 int x=11; 则表达式 (x++ * 1/3) 的值是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4920-c089-2897e034650f.html
点击查看题目
以下程序的输出是()。
struct st
{ int x; int *y;} *p;
int dt[4]={ 10,20,30,40 };
struct st aa[4]={ 50,&dt[0],60,&dt[0],60,&dt[0],60,&dt[0],};
main()
{ p=aa;
printf("%d\n",++(p->x));
}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e0346503.html
点击查看题目
下列说法中正确的是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4920-c089-2897e0346500.html
点击查看题目
下列程序的输出结果是()。
main()
{ double d=3.2; int x,y;
x=1.2; y=(x+3.8)/5.0;
printf("%d \n", d*y);
}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4920-c089-2897e0346507.html
点击查看题目
首页
>
IT互联网
>
信息技术知识竞赛c语言
题目内容
(
单选题
)
手机预览
试题通
信息技术知识竞赛c语言

有以下程序
void ss(char *s,char t)
{ while(*s)
{ if(*s==t)*s=t-′a′+′A′;
s++; } }
main()
{ char str1[100]="abcddfefdbd",c=′d′;
ss(str1,c); printf("%s\n",str1);}
程序运行后的输出结果是( )。

A、ABCDDEFEDBD

B、abcDDfefDbD

C、 abcAAfefAbA

D、Abcddfefdbd

答案:B

试题通
试题通
信息技术知识竞赛c语言
相关题目
若有说明语句:double *p,a;则能通过scanf语句正确给输入项读入数据的程序段是()。

A. *p=a;
scanf("%1f",p);

B. *p=a;
scanf("%f",p);

C. p=a;
scanf("%1f",*p);

D. p=&a;
scanf("%1f",p);

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

A. 4

B. 3

C. 2

D. 1

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e034651c.html
点击查看答案
有以下程序
#include
void fun(int *s)
{ static int j=0;
do
{ s[j]+=s[j+1];
}while(++j<2);
}
void main()
{ int k,a[10]={1,2,3,4,5};
for(k=1;k<3;k++)
fun(a);
for(k=0;k<5;k++)
printf("%d",a[k]);
}
执行后的输出结果是( )。

A. 35756

B. 23445

C. 35745

D. 12345

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

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

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

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

D. 仅仅搜索当前目录

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e034650f.html
点击查看答案
设有定义:struct {char mark[12];int num1;double num2;} t1,t2;,若变量均已正确赋初值,则以下语句中错误的是()。

A.  t1=t2;

B. t2.num1=t1.num1;  

C. t2.mark=t1.mark;

D. t2.num2=t1.num2;

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e0346502.html
点击查看答案
以下不合法的用户标识符是()。

A. j2_KEY

B. Double

C. 4d

D. _8_

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e034651a.html
点击查看答案
设有 int x=11; 则表达式 (x++ * 1/3) 的值是()。

A. 3

B. 4

C. 11

D. 12

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4920-c089-2897e034650f.html
点击查看答案
以下程序的输出是()。
struct st
{ int x; int *y;} *p;
int dt[4]={ 10,20,30,40 };
struct st aa[4]={ 50,&dt[0],60,&dt[0],60,&dt[0],60,&dt[0],};
main()
{ p=aa;
printf("%d\n",++(p->x));
}

A. 10

B. 11

C. 51

D. 60

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e0346503.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
点击查看答案
下列程序的输出结果是()。
main()
{ double d=3.2; int x,y;
x=1.2; y=(x+3.8)/5.0;
printf("%d \n", d*y);
}

A. 3

B. 3.2

C. 0

D. 3.07

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