C语言试卷

第301题

有以下程序:

#include<stdio.h>
main()
{
int a=1,b=0;
if(--a) b++;
else if(a==0) b+=2;
else b+=3;
printf("%d\n",b);
}

程序运行后的输出结果是()。

第302题

有以下程序:

#include <stdio.h>
main()
{
int a=7;
while(a--);
printf("%d\n", a);
}

程序运行后的输出结果是()。

第303题

有以下程序:

#include <stdio.h>
main()
{
int a=1,b=1;
while(a--)
b--;
printf("%d,%d\n", a,b);
}

程序的运行结果是()。

第304题

有以下程序

#include <stdio.h>
main()
{
int x,y,z;
x=y=1;
z=x++,y++,++y;
printf("%d,%d,%d\n",x,y,z);
}

程序运行后的输出结果是()。

第305题

以下程序段中的变量已定义为int类型,则

sum=pAd=5;
pAd=sum++,++pAd,pAd++;
printf("%d\n",pAd);

程序段的输出结果是()。

第306题

有以下程序

#include<stdio.h>
main()
{
int sum,pad,pAd;
sum=pad=5;
pAd=++sum,pAd++,++pad;
printf("%d\n",pad);
}

程序的输出结果是()。

第307题

有以下程序

#include <stdio.h>
main()
{
int i;
for(i=1;i<=40;i++)
{
if(i++%5==0)
if(++i%8==0)printf("%d",i);
}
printf("\n");
}

执行后的输出结果是()。

第308题

有如下程序:

#include <stdio.h>
main()
{
int a =0,b=1;
if(++a==b++)
printf("T");
else
printf("F");
printf("a=%d,b=%d\n",a,b);
printf("\n");
}

程序运行后的输出结果是()。

第309题

如下程序:

#include <stdio.h>
main()
{
int a =0,b=1;
if(a++&&b++)
printf("T");
else
printf("F");
printf("a=%d,b=%d\n",a,b);
printf("\n");
}

程序运行后的输出结果是()。

第310题

以下叙述中正确的是( )。

第311题

以下叙述中正确的是( )。

第312题

以下能正确输出字符a的语句是( )。

第313题

以下不能输出字符A的语句是( )。(注:字符A的ASCII码值 为65,字符a的ASCII码值为97。)

第314题

设有定义:

double x=2.12;

以下不能完整输出变量x值的语句是 ( )。

第315题

有以下程序: 

#include <stdio.h>
main()
{
 int k=10;
 printf("%4d,%o,%x\n",k,k,k);
}

程序的运行结果是( )。(u代表一个空格)

第316题

有以下程序:

#include <stdio.h>
main()
{
 int k=-17; 
 printf("%d,%o,%x\n",k,1-k,1-k);
}

程序的运行结果是( )。

第317题

有以下程序段:

char ch;
int k;
ch='a';
k =12;
printf("%c,%d,",ch,ch,k);
printf("k=%d\n",k);

已知字符a的ASCII码十进制值为97,则执行上述程序段后输出的结果 是( )。 

第318题

有以下程序:

#include <stdio.h>
main()
{
 int a=1,b=0;
 printf("%d,",b=a+b);
 printf("%d\n",a=2*b);
}

程序运行后的输出结果是( )。 

第319题

程序段:

int x=12;
double y=3.141593;
printf("%d%8.6f",x,y);

输出结果是( )。

第320题

有以下程序

#include <stdio.h>
main()
{
 int a=2,c=5;
 printf("a=%%d,b=%%d\n",a,c);
}

程序运行后的输出结果是( )。