试题通
试题通
APP下载
首页
>
IT互联网
>
信息技术知识竞赛c语言
试题通
搜索
信息技术知识竞赛c语言
题目内容
(
单选题
)
有以下程序
#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

答案:C

试题通
信息技术知识竞赛c语言
试题通
有以下程序
fun(int x,int y){return(x+y);}
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-58c0-c089-2897e034651c.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
点击查看题目
下列程序段执行后,s的值是( )
static char ch[]="600";
int a,s=0;
for(a=0;ch[a]>='0'&&ch[a]<='9';a++)
s=10*s+ch[a]-'0';
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e034650b.html
点击查看题目
在以下定义中,标识符p( )。
int (*p)[3];
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e0346519.html
点击查看题目
有以下程序
  #include
  main()
  { unsigned char a=8,c;
  c=a>>3;
  printf("%d\n",c);
  }
  程序运行后的输出结果是()。  
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346504.html
点击查看题目
#include "stdio.h"
int digits(int n)
{
int c=0;
do {
c++;
n/=10;
}while(n);
return c;
}
void main( )
{
printf("%d",digits(824));
}
程序运行结果是 ( ) 。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346507.html
点击查看题目
有以下程序
main()
{int a=0,b=0,c=0,d=0;
if(a=1) b=1;c=2;
else d=3;
printf("%d,%d,%d,%d\n",a,b,c,d);
}
程序输出()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346511.html
点击查看题目
以下程序的输出结果是()。
main()
{ int i,j,x=0;
for(i=0;i<2;i++)
{ x++;
for(j=0;j<3;j++)
{ if(j%2)continue;
x++;
}
x++;
}
printf("x=%d\n",x);
}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346507.html
点击查看题目
若有定义:int b[5];则以下对b 数组元素的正确引用是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e034651a.html
点击查看题目
有以下程序
fun(int x)
{int p;
if(x==0║x==1) return(3);
p=x-fun(x-2); return p; }
main()
{ prinf("%d\n",fun(7));}
执行后的输出结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e034651e.html
点击查看题目
首页
>
IT互联网
>
信息技术知识竞赛c语言
题目内容
(
单选题
)
手机预览
试题通
信息技术知识竞赛c语言

有以下程序
#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

答案:C

试题通
试题通
信息技术知识竞赛c语言
相关题目
有以下程序
fun(int x,int y){return(x+y);}
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-58c0-c089-2897e034651c.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
点击查看答案
下列程序段执行后,s的值是( )
static char ch[]="600";
int a,s=0;
for(a=0;ch[a]>='0'&&ch[a]<='9';a++)
s=10*s+ch[a]-'0';

A. 600

B. 6

C. 0

D. 出错

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e034650b.html
点击查看答案
在以下定义中,标识符p( )。
int (*p)[3];

A. 定义不合法

B. 是一个指针数组名,每个元素是一个指向整数变量的指针

C. 是一个指针,它指向一个具有三个元素的一维数组

D. 是一个指向整型变量的指针

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e0346519.html
点击查看答案
有以下程序
  #include
  main()
  { unsigned char a=8,c;
  c=a>>3;
  printf("%d\n",c);
  }
  程序运行后的输出结果是()。  

A. 32

B. 16

C. 1

D. 0

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346504.html
点击查看答案
#include "stdio.h"
int digits(int n)
{
int c=0;
do {
c++;
n/=10;
}while(n);
return c;
}
void main( )
{
printf("%d",digits(824));
}
程序运行结果是 ( ) 。

A. 8

B. 3

C. 4

D. 5

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346507.html
点击查看答案
有以下程序
main()
{int a=0,b=0,c=0,d=0;
if(a=1) b=1;c=2;
else d=3;
printf("%d,%d,%d,%d\n",a,b,c,d);
}
程序输出()。

A. 0,1,2,0

B. 0,0,0,3

C. 1,1,2,0

D. 编译有错

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346511.html
点击查看答案
以下程序的输出结果是()。
main()
{ int i,j,x=0;
for(i=0;i<2;i++)
{ x++;
for(j=0;j<3;j++)
{ if(j%2)continue;
x++;
}
x++;
}
printf("x=%d\n",x);
}

A. x=4

B. x=8

C. x=6

D. x=12

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346507.html
点击查看答案
若有定义:int b[5];则以下对b 数组元素的正确引用是()。

A. *b[5]

B. b+2

C. *(*(b+2))

D. *(b+2)

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e034651a.html
点击查看答案
有以下程序
fun(int x)
{int p;
if(x==0║x==1) return(3);
p=x-fun(x-2); return p; }
main()
{ prinf("%d\n",fun(7));}
执行后的输出结果是()。

A. 7

B. 3

C. 2

D. 0

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