更多"[单选题]有以下程序
#include <stdio.h>
ma"的相关试题:
[单选题]有以下程序
#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
[单选题]有以下程序
#include
main()
{int a=2,b;
b=a<<2; printf(“%d\n”,b);
}
程序运行后的输出结果是()。
A.2
B.4
C.6
D.8
[单选题]有以下程序
#include
main()
{int c[3]={0},k,I;
while((k=getchar())!=’\n’)
c[k-‘A’]++;
for(i=0;i<3;i++) printf(“%d”,c[i]); printf(“\n”);
}
若程序运行时从键盘输入ABCACC<回车>,则输出结果为 ( ) 。
A.211
B.212
C.213
D.214
[单选题]有以下程序
#include
Main()
{int a=1,b=0;
if(--a) b++;
else if(a==0) b+=2;
else b+=3;
printf(“%d\n”,b);
}
程序运行后的输出结果是()。
A.0
B.1
C.2
D.3
[单选题]有以下程序
#include
void main()
{ int s;
scanf("%d",&s);
while(s>0)
{ switch(s)
{ case 1:printf("%d",s+5);
case 2:printf("%d",s+4); break;
case 3:printf("%d",s+3);
default:printf("%d",s+1);break;
}
scanf("%d",&s);
}
}
运行时,若输入1 2 3 4 5 0<回车>,则输出结果是( )。
A.6566456
B.66656
C.66666
D.6666656
[单选题]设有如下程序:
#include
main()
{ int **k, *j, i=100;
j=&i; k=&j;
printf("%d\n", **k);
}
上面程序的输出结果是()。
A.运行错误
B.100
C.i的地址
D.j的地址
[单选题]有以下程序
#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
main()
{ int x=1,y=0;
if(!x) y++;
else if(x==0)
if (x) y+=2;
else y+=3;
printf("%d\n",y);
}
程序运行后的输出结果是()。
A.3
B.2
C.1
D.0
[单选题]有以下程序
#include
main()
{ unsigned char a=8,c;
c=a>>3;
printf("%d\n",c);
}
程序运行后的输出结果是()。
A.32
B.16
C.1
D.0
[单选题]有以下程序
#include
main()
{ char a[30],b[30];
scanf("%s",a);
gets(b);
printf("%s\n %s\n",a,b);
}
程序运行时若输入:
how are you? I am fine<回车>
则输出结果是()。
A.how are you?
B.how
are you? I am fine
C.how are you? I am fine
D.how
are
you?