[单选题]

以下程序中的for循环执行的次数是______。 #define N 2 #define M N+1 #define NUM 2*M+1 main() { int i; for(i=1;i<NUM;i++) printf("%d/n",i); }

A.5

B.6

C.7

D.8

参考答案与解析:

相关试题

有如下程序:# define N 2# define M N£«1# defin

[单选题]有如下程序: # define N 2 # define M N+1 # define NUM 2*M+1 # main() { int i; for(i=1; i<=NUM; i++) printf("% d/n", i); } 该程序中的for循环执行的次数是______。A.5B.6C.7D.8

  • 查看答案
  • 以下程序段中Do...Loop循环执行的次数为()。n=5Dolf n Mod

    [单选题]以下程序段中Do...Loop循环执行的次数为( )。 n=5 Do lf n Mod 2=0 Then n=n/2 Else n=n*3+1 End If Loop untiln=1A.4B.3C.5D.2

  • 查看答案
  • 执行下列程序的结果是()。#define N 5#define H(x)((N£

    [单选题]执行下列程序的结果是( )。 #define N 5 #define H(x) ((N+2)*x) main() { int a=2,b=3,C; c=H(a+b); printf("%d",c); }A.15B.17C.23D.35

  • 查看答案
  • 以下程序段中Do...Loop循环执行的次数为______。 n=5Do if

    [单选题]以下程序段中Do...Loop循环执行的次数为______。 n=5 Do if n mod 2=0 then n=n/2 else n=n*3+1 end if Loop until n=1A.4B.3C.5D.2

  • 查看答案
  • 有以下程序 #include #define N 5 #define M N£

    [单选题]有以下程序 include define N 5 define M N£«1有以下程序 #include <stdio.h> #define N 5 #define M N+1 #define f(x) (x*M) main() { int i1,i2; i1=f(2) i2=f(1+1); printf("%d %d/n",i1,i2); } 程序的运行结果是______。A.12 12B.11 7C.11 11D.12 7

  • 查看答案
  • 下列中 a的值是_________ #define AAA 200 #defin

    [主观题]下列中 a的值是_________#define AAA 200#define BBB AAA+100int a= BBB*2

  • 查看答案
  • 若有以下宏定义: # define N 2 # define Y(n) ((N£

    [单选题]若有以下宏定义: # define N 2 # define Y(n) ((N+1)*n) 则执行语句z=2*(N+Y(5));后的结果是A.语句有错误B.z=34C.z=70D.z无定值

  • 查看答案
  • 有如下程序#define N2#define MN£«1#define NUM2

    [单选题]有如下程序#define N 2#define M N+1#define NUM 2*M+1main(){ int i; for(i = 1; i <= NUM; i++) printf("%d/n",i);}该程序中for循环执行的次数是A.5 B.6 C.7 D.8

  • 查看答案
  • 有以下程序:#include#define N 5#define M N£«1#

    [单选题]有以下程序:includedefine N 5define M N£«1define f(x)(x*M)main(){int i1,i2;i1=f有以下程序: #include<stdio.h> #define N 5 #define M N+1 #define f(x)(x*M) main() {int i1,i2; i1=f(2); i2=f(1+1); printf("%d%d",i1,i2); } 程序的运行结果是( )。A.12 12B.11 7C.11 11D.12 7

  • 查看答案
  • 若有以下宏定义:#define N 2#define Y(n)((N£«1)*n

    [单选题]若有以下宏定义:#define N 2#define Y(n)((N+1)*n)则执行语句z=2*(N+Y(5));后的结果是( )。A.语句有错误B.z=34C.z=70D.z无定值

  • 查看答案
  • 以下程序中的for循环执行的次数是______。#define N2#defin