试题通
试题通
APP下载
首页
>
IT互联网
>
信息技术知识竞赛c语言
试题通
搜索
信息技术知识竞赛c语言
题目内容
(
单选题
)
设实型变量为f1、f2、f3、f4的值分别为4,3,2,1整型变量m1、m2
的值为1。表达式“(m1=f1>f2)&&(m2=f3

A、0

B、1

C、2

D、出错

答案:A

试题通
信息技术知识竞赛c语言
试题通
以下数组定义中不正确的是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e034650c.html
点击查看题目
下列if语句中,不正确的是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4920-c089-2897e0346510.html
点击查看题目
有以下程序
#include “stdio.h”
fun(int x, int y){ return (x+y); }
void main()
{ int a=1, b=2, c=3, sum;
sum=fun((a++,b++,a+b),c++);
printf("%d\n",sum);
}
执行后的输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e0346511.html
点击查看题目
若给出以下定义:
char x[ ]="abcdefg";
char y[ ]={'a','b','c','d','e','f','g'};
则正确的叙述为( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e034651d.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
点击查看题目
有以下程序
#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);
}
程序运行后的输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346514.html
点击查看题目
有以下程序
  #include
  #define S(x) 4*(x)*x+1
  main()
  { int k=5,j=2;
  printf("%d\n",S(k+j));
  }
  程序运行后的输出结果是()。   
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346501.html
点击查看题目
有以下程序
main()
{int i;
for(i=1;i<=40;i++)
{if(i++%5==0)
if (++i%8==0) printf("%d",i) ;}
printf("\n") ;} 执行后的输出结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e034651b.html
点击查看题目
有以下程序
main()
{ char s[ ]= "abcde"; s+=2; printf("%d\n",s[0]); }
执行后的结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346509.html
点击查看题目
以下程序有语法性错误,有关错误原因的正确说法是( )。
void main()
{
int G=5,k;
void prt_char();
......
k=prt_char(G);
......
}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e034651a.html
点击查看题目
首页
>
IT互联网
>
信息技术知识竞赛c语言
题目内容
(
单选题
)
手机预览
试题通
信息技术知识竞赛c语言

设实型变量为f1、f2、f3、f4的值分别为4,3,2,1整型变量m1、m2
的值为1。表达式“(m1=f1>f2)&&(m2=f3

A、0

B、1

C、2

D、出错

答案:A

试题通
试题通
信息技术知识竞赛c语言
相关题目
以下数组定义中不正确的是()。

A. int a[2][3];

B. int b[][3]={0,1,2,3};

C. int c[100][100]={0};

D. int d[3][]={{1,2},{1,2,3},{1,2,3,4}};

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

A. if(x>y);

B. if(x==y) x+=y;

C. if(x!=y) scanf("%d",&x) else x=1;

D. if(x<y) {x++;y++;}

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4920-c089-2897e0346510.html
点击查看答案
有以下程序
#include “stdio.h”
fun(int x, int y){ return (x+y); }
void main()
{ int a=1, b=2, c=3, sum;
sum=fun((a++,b++,a+b),c++);
printf("%d\n",sum);
}
执行后的输出结果是( )。

A. 6

B. 7

C. 8

D. 9

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e0346511.html
点击查看答案
若给出以下定义:
char x[ ]="abcdefg";
char y[ ]={'a','b','c','d','e','f','g'};
则正确的叙述为( )。

A. 数组x和数组y等价

B. 数组x和数组y的长度相同

C. 数组x的长度大于数组y的长度

D. 数组x的长度小于数组y的长度

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e034651d.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
点击查看答案
有以下程序
#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

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346514.html
点击查看答案
有以下程序
  #include
  #define S(x) 4*(x)*x+1
  main()
  { int k=5,j=2;
  printf("%d\n",S(k+j));
  }
  程序运行后的输出结果是()。   

A. 197

B. 143

C. 33

D. 28

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346501.html
点击查看答案
有以下程序
main()
{int i;
for(i=1;i<=40;i++)
{if(i++%5==0)
if (++i%8==0) printf("%d",i) ;}
printf("\n") ;} 执行后的输出结果是()。

A. 5

B. 24

C. 32

D. 40

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e034651b.html
点击查看答案
有以下程序
main()
{ char s[ ]= "abcde"; s+=2; printf("%d\n",s[0]); }
执行后的结果是()。

A. 输出字符a的ASCII码

B. 输出字符c的ASCII码

C. 输出字符c

D. 程序出错

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346509.html
点击查看答案
以下程序有语法性错误,有关错误原因的正确说法是( )。
void main()
{
int G=5,k;
void prt_char();
......
k=prt_char(G);
......
}

A. 语句void prt_char(); 有错,它是函数调用语句,不能用void说明

B. 变量名不能使用大写字母

C. 函数说明和函数调用之间有矛盾

D. 函数名不能使用下划线

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