以下for语句构成的循环执行的次数是()
#include
#define N 2
#define M N+l
#define NUM(M+1)*M/2
main()
{int i,n=0;
for(i=1;i<=NUM;i++)
{n++;printf(“%d”,n);}
printf(“\n”);}
A.5
B.6
C.8
D.9
您可能感兴趣的试卷
你可能感兴趣的试题
以下程序的输出结果是()
#include
main()
{inti:
for(i=l;i<=5;i++)
{if(i%2)
printf(“*”);
else
continue;
printf(“*”);}
printf(“$\n”);I
A.*#*#*#$
B.#*#*#*$
C.*#*#$
D.#*#*$
设有以下语句:
char str1[]= “string”,str2[8],*str3,*str4= “ string”;
则不能对库函数strcpy(复制字符串)的正确调用的是()
A.strepy(str1,“HELLO1”);
B.strepy(str2,“HELL02”);
C.strcpy(str3, “HELL03”)
D.strcpy(str4, “HELLO4”);
以下程序的输出结果是()
#include
union pw
{int i;char ch[2];}a;
main( )
{a.ch[0]=13;a.ch[1]=0;printf(”%d\n”,a.i);}
(注意:ch[0]在低字节,ch[1]在高字节。)
A.13
B.14
C.208
D.209
设有以下语句(其中0≤i<10),则不能对a数组元素的正确引用是()
int a[10]={0,l,2,3,4,5,6,7,8,9},*p=a;
A.a[p-a]
B.*(&a[i])
C.p[i]
D.*(*(a+i))
A.自动(auto)
B.静态(static)
C.寄存器(register)
D.外部(extern)
以下程序的输出结果是()
#include
main()
{int a,b,d=241;
a=d/100%9;
b=(-1)&&(-1);
printf(“%d,%d\n”,a,b);}
A.6,1
B.6,0
C.2,1
D.2,0
以下程序的输出结果是()
#include
main()
{int a=2,c=5;
printf(“a=%%d,b=%%d\n”,a,c);}
A.a=%2,b=%5
B.a=2,b=5
C.a=%%d、b=%%d
D.a=%d、b=%d
以下程序的输出结果是()
#include
#include
main()
{char str[12]={‘8’,‘t’,‘r’,‘i’, ‘n’,‘g’,‘、0’,‘a’};
printf(“%d\n”,strlen(str));}
A.6
B.7
C.8
D.12
A.不能使用do—while语句构成的循环
B.do-while语句构成的循环必须用break语句才能退出
C.do-while语句构成的循环,当while语句中的表达式值为非零时结束循环
D.do-while语句构成的循环,当while语句中的表达式值为零时结束循环
A.-12
B.0
C.3
D.9
最新试题
若有以下的定义:int a[]= {1,2,3,4}.*p=a;则值为3的表式是()
语句while(E);中的条件E等价于()
执行int x,y,z.k;x=(y=4,z=16,k=32)后,x的值是()
调用函数:strcat(strcpy(strl,str2),str3)的结果是()
给出以下定义:char a[]=″abc″;char b[]={′a′,′b′,′c′};则正确的叙述是()
写出程序执行结果
写出程序执行结果
编程:输入10个整数,输出其平均值。
写出程序执行结果
写出程序执行结果