APP下载
首页
>
IT互联网
>
信息技术知识竞赛c语言
搜索
信息技术知识竞赛c语言
题目内容
(
单选题
)
下列条件语句中,输出结果与其他语句不同的是()。

A、if(a) printf(“%d\n”,x); else printf(“%d\n”,y);

B、if(a==0) printf(“%d\n”,y); else printf(“%d\n”,x);

C、if(a!=0) printf(“%d\n”,x); else printf(“%d\n”,y);

D、if(a==0) printf(“%d\n”,x); else printf(“%d\n”,y);

答案:D

信息技术知识竞赛c语言
现有程序完成a、b两个值的交换,空白处正确的答案应该是( )。
main()
{int a,b,t;
t=b ;
b=a ;
________ ;
}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e034650d.html
点击查看题目
下列程序的输出结果是()。
int b=2;
int func(int *a)
{ b += *a; return(b);}
main()
{ int a=2, res=2;
res += func(&a);
printf("%d \n",res);
}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e0346507.html
点击查看题目
有以下函数
int fun(char *x,char *y)
{ int n=0;
while((*x==*y)&&*x!=’\0’) {x++;y++;n++;}
return n;
}
函数的功能是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346510.html
点击查看题目
有以下程序
#include
main()
{int c[3]={0},k,I;
while((k=getchar())!=’\n’)
c[k-‘A’]++;
for(i=0;i<3;i++) printf(“%d”,c[i]); printf(“\n”);
}
若程序运行时从键盘输入ABCACC<回车>,则输出结果为 ( ) 。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e034651b.html
点击查看题目
下列对字符串的定义中,错误的是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346514.html
点击查看题目
C语言中最简单的数据类型包括()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4920-c089-2897e0346503.html
点击查看题目
下面的程序执行后,文件test中的内容是 ()。
void fun(char *fname,char *st)
{ FILE *myf; int i;
myf=fopen(fname,"w" );
for(i=0;st[i];i++)
fputc(st[i],myf);
fputc('\0',myf);
fclose(myf);
}
main()
{ fun("test","new world"); fun("test","hello,");}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e034650e.html
点击查看题目
已知
#int t=0;
while (t=1)
{...}
则以下叙述正确的是 ( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346520.html
点击查看题目
有以下程序
main()
{char s[ ]={ "aeiou"},*ps;
ps=s; printf("%c\n",*ps+4);}程序运行后的输出结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e0346503.html
点击查看题目
表达式:10!=9的值是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346519.html
点击查看题目
首页
>
IT互联网
>
信息技术知识竞赛c语言
题目内容
(
单选题
)
手机预览
信息技术知识竞赛c语言

下列条件语句中,输出结果与其他语句不同的是()。

A、if(a) printf(“%d\n”,x); else printf(“%d\n”,y);

B、if(a==0) printf(“%d\n”,y); else printf(“%d\n”,x);

C、if(a!=0) printf(“%d\n”,x); else printf(“%d\n”,y);

D、if(a==0) printf(“%d\n”,x); else printf(“%d\n”,y);

答案:D

信息技术知识竞赛c语言
相关题目
现有程序完成a、b两个值的交换,空白处正确的答案应该是( )。
main()
{int a,b,t;
t=b ;
b=a ;
________ ;
}

A. a=b

B. a=t

C. b=t

D. t=a

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e034650d.html
点击查看答案
下列程序的输出结果是()。
int b=2;
int func(int *a)
{ b += *a; return(b);}
main()
{ int a=2, res=2;
res += func(&a);
printf("%d \n",res);
}

A. 4

B. 6

C. 8

D. 10

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e0346507.html
点击查看答案
有以下函数
int fun(char *x,char *y)
{ int n=0;
while((*x==*y)&&*x!=’\0’) {x++;y++;n++;}
return n;
}
函数的功能是()。

A. 查找x和y所指字符串中是否有’\0’

B. 统计x和y所指字符串中最前面连续相同的字符个数

C. 将y所指字符串赋给x所指存储空间

D. 统计x和y所指字符串中相同的字符个数

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346510.html
点击查看答案
有以下程序
#include
main()
{int c[3]={0},k,I;
while((k=getchar())!=’\n’)
c[k-‘A’]++;
for(i=0;i<3;i++) printf(“%d”,c[i]); printf(“\n”);
}
若程序运行时从键盘输入ABCACC<回车>,则输出结果为 ( ) 。

A. 211

B. 212

C. 213

D. 214

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e034651b.html
点击查看答案
下列对字符串的定义中,错误的是( )。

A. char str[7] = "FORTRAN";

B. char str[] = "FORTRAN";

C. char *str = "FORTRAN";

D. char str[] = {'F','O','R','T','R','A','N',0};

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346514.html
点击查看答案
C语言中最简单的数据类型包括()。

A. 整型、实型、逻辑型

B. 整型、实型、字符型

C. 整型、字符型、逻辑型

D. 整型、实型、逻辑型、字符型

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4920-c089-2897e0346503.html
点击查看答案
下面的程序执行后,文件test中的内容是 ()。
void fun(char *fname,char *st)
{ FILE *myf; int i;
myf=fopen(fname,"w" );
for(i=0;st[i];i++)
fputc(st[i],myf);
fputc('\0',myf);
fclose(myf);
}
main()
{ fun("test","new world"); fun("test","hello,");}

A. hello,

B. new worldhello,

C. new world

D. hello, rld

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e034650e.html
点击查看答案
已知
#int t=0;
while (t=1)
{...}
则以下叙述正确的是 ( )。

A. 循环控制表达式的值为0

B. 循环控制表达式的值为1

C. 循环控制表达式不合法

D. 以上说法都不对

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346520.html
点击查看答案
有以下程序
main()
{char s[ ]={ "aeiou"},*ps;
ps=s; printf("%c\n",*ps+4);}程序运行后的输出结果是()。

A. a

B. e

C. u

D. 元素s[4]的地址

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e0346503.html
点击查看答案
表达式:10!=9的值是()。

A. ture

B. 非零值

C. 1

D. 0

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