更多"[单选题]请读程序:
main()
{ static int a[]="的相关试题:
[单选题]请读程序:
main()
{ int a=1,b=2;
printf("%d\n",a=a+1,a+6,b+2);}
则上面程序的输出结果是()。
A.2
B.3
C.4
D.1
[单选题]有以下程序
int fun(int x[],int n)
{static int sum=0,i;
for(i=0;iA.45
B.50
C.60
D.55
[单选题]有以下程序
fun(int x,int y)
{static int m=0,i=2; i+=m+1;m=i+x+y; return m; }
main()
{int j=1,m=1,k;
k=fun(j,m); printf("%d,",k);
k=fun(j,m);
printf("%d\n",k);
}
执行后的输出结果
A.5,5
B.5,11
C.11,11
D.11,5
[单选题]请读程序:
main()
{ char *p;
char s[80];
scanf("%s",s);
p=s[0];
printf("%s",p);
}
请判断上面程序选出正确答案是()。
A.错误:p=s[0];
正确:p=*s;
B.错误:p=s[0];
正确:p=s[];
C.错误:p=s[0];
正确:p=s;
D.错误:p=s[0];
正确:p=&s;
[单选题]有以下程序
int add(int a,int b){return+b};}
main()
{int k,(*f)(),a=5,b=10;
f=add;
... }则以下函数调用语句错误的是()。
A.k=(*f)(a,b);
B.k=add(a,b);
C.k=*f(a,b);
D.k=f(a,b);
[单选题]有以下程序
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
[单选题]有以下程序
#include
int fun()
{static int x=1;
x*=2; return x;
}
void main()
{int i,s=1;
for (i=1;i<=2;i++) s=fun();
printf("%d\n",s);
}
执行后的输出结果是( )。
A.1
B.2
C.3
D.4
[单选题]有以下程序
main()
{int a=1,b=3,c=5;
int *p1=&a,*p2=&b,*p=&c;
*p=*p1*(*p2);
printf("%d\n",c);
}
执行后的输出结果是()。
A.1
B.2
C.3
D.4
[单选题]有以下程序
#include "stdio.h"
void main()
{ int x=0x02ff,y=0x0ff00;
printf("%d\n",(x&y)>>4|0x005f);
}
执行后的输出结果是( )。
A.127
B.255
C.128
D.1
[单选题]有以下程序
#include "stdio.h"
void main()
{ int c;
while((c=getchar())!='\n')
switch(c -'2')
{ case 0:
case 1: putchar(c+4);
case 2: putchar(c+4);break;
case 3: putchar(c+3);
default: putchar(c+2);break;
}
printf("\n");
}
通过键盘输入446755,执行后的输出结果是( )。
A.888988
B.668966
C.88898787
D.66898787
[单选题]有以下程序
#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
[单选题]有以下程序
#include
void main()
{
int j,a[]={1,3,5,7,9,11,13,15},*p=a+5;
for(j=3;j;j--)
{
switch(j)
{
case 1:
case 2:printf("%d",*p++);
case 3:printf("%d",*(--p));
}
}
}
执行后的输出结果是( )。
A.9911
B.79911
C.99999
D.991113