试题通
试题通
APP下载
首页
>
IT互联网
>
信息技术知识竞赛c语言
试题通
搜索
信息技术知识竞赛c语言
题目内容
(
单选题
)
以下程序的输出结果是()。
main()
{ int a=4,b=5,c=0,d;
d=!a&&!b||!c;
printf("%d\n",d);}

A、1

B、0

C、非0数

D、-1

答案:A

试题通
信息技术知识竞赛c语言
试题通
有以下程序
#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
点击查看题目
设有以下定义和语句
char str[20]="Program",*p;
p=str;
则以下叙述中正确的是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346503.html
点击查看题目
有以下程序
main()
{int i,t[][3]={9,8,7,6,5,4,3,2,1};
for(i=0;i<3;i++) printf("%d",t[2-i][i]);
}
程序执行后的输出结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346512.html
点击查看题目
#include "stdio.h"
void main( )
{ char str[80];
scanf("%s",str);
insert(str);
}
insert(char s[])
{
int i;
for(i=strlen(s);i>0;i--)
{ s[2*i]=s[i];
s[2*i-1]=' ';
}
printf("%s",s);
}
如果输入的字符串是abcd, 则程序的运行结果是 ( ) 。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346508.html
点击查看题目
有以下程序
#include
void fun (char*c,int d)
{*c=*c+1;d=d+1;
printf("%c,%c,",*c,d);
}
void main()
{char b='a',a='A';
fun(&b,a); printf("%c,%c\n",b,a);
}
执行后的输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346517.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
点击查看题目
下列程序的输出结果是()。
struct abc
{ int a, b, c; };
main()
{ struct abc s[2]={{1,2,3},{4,5,6}}; int t;
t=s[0].a+s[1].b;
printf("%d \n",t);
}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e0346508.html
点击查看题目
有以下程序
  #include
  main()
  { char b,c; int i;
  b='a'; c='A';
  for(i=0;i<6;i++)
  { if(i%2) putchar(i+b);
  else putchar(i+c);
  } printf("\n");
  }
程序运行后的输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e034651e.html
点击查看题目
下列程序段的执行结果是输出( )。
x=3;
do

printf("%2d",x--);
} while(!x);
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e0346520.html
点击查看题目
有以下程序
main()
{ int i,s=1;
for (i=1;i<50;i++)
if(!(i%5)&&!(i%3)) s+=i;
printf("%d\n",s);}
程序的输出结果是 ( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e034651d.html
点击查看题目
首页
>
IT互联网
>
信息技术知识竞赛c语言
题目内容
(
单选题
)
手机预览
试题通
信息技术知识竞赛c语言

以下程序的输出结果是()。
main()
{ int a=4,b=5,c=0,d;
d=!a&&!b||!c;
printf("%d\n",d);}

A、1

B、0

C、非0数

D、-1

答案:A

试题通
试题通
信息技术知识竞赛c语言
相关题目
有以下程序
#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
点击查看答案
设有以下定义和语句
char str[20]="Program",*p;
p=str;
则以下叙述中正确的是()。

A. *p与str[0]的值相等

B. str与p的类型完全相同

C. str数组长度和p所指向的字符串长度相等

D. 数组str中存放的内容和指针变量p中存放的内容相同

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346503.html
点击查看答案
有以下程序
main()
{int i,t[][3]={9,8,7,6,5,4,3,2,1};
for(i=0;i<3;i++) printf("%d",t[2-i][i]);
}
程序执行后的输出结果是()。

A. 7 5 3

B. 3 5 7

C. 3 6 9

D. 7 5 1

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346512.html
点击查看答案
#include "stdio.h"
void main( )
{ char str[80];
scanf("%s",str);
insert(str);
}
insert(char s[])
{
int i;
for(i=strlen(s);i>0;i--)
{ s[2*i]=s[i];
s[2*i-1]=' ';
}
printf("%s",s);
}
如果输入的字符串是abcd, 则程序的运行结果是 ( ) 。

A.
a
b
c
d

B. a c b d

C. a b c d

D. d
c
b
a

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346508.html
点击查看答案
有以下程序
#include
void fun (char*c,int d)
{*c=*c+1;d=d+1;
printf("%c,%c,",*c,d);
}
void main()
{char b='a',a='A';
fun(&b,a); printf("%c,%c\n",b,a);
}
执行后的输出结果是( )。

A. b,B,b,A

B. b,B,a,A

C. b,b,a,a

D. b,b,A,a

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346517.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
点击查看答案
下列程序的输出结果是()。
struct abc
{ int a, b, c; };
main()
{ struct abc s[2]={{1,2,3},{4,5,6}}; int t;
t=s[0].a+s[1].b;
printf("%d \n",t);
}

A. 5

B. 6

C. 7

D. 8

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e0346508.html
点击查看答案
有以下程序
  #include
  main()
  { char b,c; int i;
  b='a'; c='A';
  for(i=0;i<6;i++)
  { if(i%2) putchar(i+b);
  else putchar(i+c);
  } printf("\n");
  }
程序运行后的输出结果是( )。

A. ABCDEF

B. AbCdEf

C. aBcDeF

D. abcdef

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e034651e.html
点击查看答案
下列程序段的执行结果是输出( )。
x=3;
do

printf("%2d",x--);
} while(!x);

A. 3 2 1

B. 3

C. 2 1

D. 2 1 0

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e0346520.html
点击查看答案
有以下程序
main()
{ int i,s=1;
for (i=1;i<50;i++)
if(!(i%5)&&!(i%3)) s+=i;
printf("%d\n",s);}
程序的输出结果是 ( )。

A. 409

B. 277

C. 1

D. 91

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