APP下载
首页
>
IT互联网
>
信息技术知识竞赛c语言
搜索
信息技术知识竞赛c语言
题目内容
(
单选题
)
以下程序输出结果是()。       
main()
{ int m=5;
if(m++>5) printf("%d\n",m);
esle printf("%d\n",m- -);
}

A、7

B、6

C、5

D、4

答案:B

信息技术知识竞赛c语言
#include
void disp(char *string)
{
if(*string)
{
disp( string+1);
putchar (*string);
}
}
void main()
{
disp("abcdefg");
}
程序的运行结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346506.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
点击查看题目
下列程序段的执行结果是输出( )。
x=3;
do

printf("%2d",x--);
} while(!x);
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e0346520.html
点击查看题目
有以下程序
#include "stdio.h"
void main()
{ int a=0,b=1,c=0,d=20;
if(a) d=d-10;
else if(!b)
if(!c) d=1;
else d=25;
printf("d=%d\n",d);
}
执行后的输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e034650a.html
点击查看题目
有以下程序
#include "stdio.h"
void main()
{ int a=1;
char c='a';
float f=2.0;
printf("%d\n",(!(a==0),f!=0&&c=='A'));
}
执行后的输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e034650d.html
点击查看题目
执行以下语句:x+=y;y=x-y;x-=y;的功能是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e034651c.html
点击查看题目
下程序运行后的输出结果是() 。
  #include
  main()
  { int a;
  a=(int)((double)(3/2)+0.5+(int)1.99*2);
  printf("%d\n",a);
  }
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346505.html
点击查看题目
有以下程序
#include
void main ( )
{ int a[]={1, 2, 3, 4, 5} ;
int x, y, *p;
p=&a[0];
x=*(p+2);
y=*(p+4);
printf("%d,%d,%d\n", *p, x, y);
}
执行后的输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e034651d.html
点击查看题目
下列条件语句中,输出结果与其他语句不同的是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e034650b.html
点击查看题目
有以下程序
#include
main()
{ char p[]={′a′, ′b′, ′c′},q[10]={ ′a′, ′b′, ′c′};
printf("%d%d\n",strlen(p),strlen(q));}
以下叙述中正确的是 ( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346523.html
点击查看题目
首页
>
IT互联网
>
信息技术知识竞赛c语言
题目内容
(
单选题
)
手机预览
信息技术知识竞赛c语言

以下程序输出结果是()。       
main()
{ int m=5;
if(m++>5) printf("%d\n",m);
esle printf("%d\n",m- -);
}

A、7

B、6

C、5

D、4

答案:B

信息技术知识竞赛c语言
相关题目
#include
void disp(char *string)
{
if(*string)
{
disp( string+1);
putchar (*string);
}
}
void main()
{
disp("abcdefg");
}
程序的运行结果是( )。

A. abcdefg

B. gfedcba

C. abcd

D. dcba

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346506.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
点击查看答案
下列程序段的执行结果是输出( )。
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
点击查看答案
有以下程序
#include "stdio.h"
void main()
{ int a=0,b=1,c=0,d=20;
if(a) d=d-10;
else if(!b)
if(!c) d=1;
else d=25;
printf("d=%d\n",d);
}
执行后的输出结果是( )。

A. d=10

B. d=15

C. d=20

D. d=25

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e034650a.html
点击查看答案
有以下程序
#include "stdio.h"
void main()
{ int a=1;
char c='a';
float f=2.0;
printf("%d\n",(!(a==0),f!=0&&c=='A'));
}
执行后的输出结果是( )。

A. 3

B. 2

C. 1

D. 0

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e034650d.html
点击查看答案
执行以下语句:x+=y;y=x-y;x-=y;的功能是()。

A. 把x和y按从大到小排列

B. 把x和y按从小到大排列

C. 无确定结果

D. 交换x和y中的值

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e034651c.html
点击查看答案
下程序运行后的输出结果是() 。
  #include
  main()
  { int a;
  a=(int)((double)(3/2)+0.5+(int)1.99*2);
  printf("%d\n",a);
  }

A. 3

B. 2

C. 0

D. 1

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346505.html
点击查看答案
有以下程序
#include
void main ( )
{ int a[]={1, 2, 3, 4, 5} ;
int x, y, *p;
p=&a[0];
x=*(p+2);
y=*(p+4);
printf("%d,%d,%d\n", *p, x, y);
}
执行后的输出结果是( )。

A. 1,3,5

B. 1,2,3

C. 1,2,4

D. 1,4,5

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e034651d.html
点击查看答案
下列条件语句中,输出结果与其他语句不同的是()。

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);

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e034650b.html
点击查看答案
有以下程序
#include
main()
{ char p[]={′a′, ′b′, ′c′},q[10]={ ′a′, ′b′, ′c′};
printf("%d%d\n",strlen(p),strlen(q));}
以下叙述中正确的是 ( )。

A. 在给p和q数组置初值时,系统会自动添加字符串结束符,故输出的长度都为3

B. 由于p数组中没有字符串结束符,长度不能确定,但q数组中字符串长度为3

C. 由于q数组中没有字符串结束符,长度不能确定,但p数组中字符串长度为3

D. 由于p和q数组中都没有字符串结束符,故长度都不能确定

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