单项选择题
以下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
