[单选题]

( 35 )有以下程序

#include <stdio.h>

#define SUB ( a ) ( a ) - ( a )

main ()

{ int a=2,b=3,c=5,d;

d=SUB ( a+b ) *c;

printf ( " %d \ n " ,d ) ;

}

程序运行后的输出结果是

A. ) 0

B. ) -12

C. ) -20

D. ) 10

参考答案与解析:

相关试题

(35)有以下程序#include <stdio.h>#define S(x)

[单选题](35)有以下程序#include <stdio.h>#define S(x) 4*(x)*x+1main(){ int k=5,j=2;printf("%d/n",S(k+j));}程序运行后的输出结果是A.)197B.)143C.)33D.)28

  • 查看答案
  • 有以下程序#inculde <stdio.h>#deFine SUB(a) (a

    [单选题]有以下程序#inculde <stdio.h>#deFine SUB(a) (a) (a)main(){ int a=2,B=3,c=5,d;d=SUB(a+B)*c;printF(”%d/n”,d);}程序运行后的输山结果是A.0B.-12C.-20D.10

  • 查看答案
  • (36)有以下程序 #include <stdio.h> #define PT

    [单选题](36)有以下程序#include <stdio.h>#define PT 3.5;#define S(x) PT*x*x;main(){ int a=1, b=2; printf(“%4.1f/n”,S(a+b));}程序运行后输出的结果是A.)14.0 B)31.5 C)7.5 D)程序有错无输出结果

  • 查看答案
  • 有以下程序#include <stdio.h>#define PT 3.5 ;#

    [单选题]有以下程序#include <stdio.h>#define PT 3.5 ;#define S(x) PT*x*x ;main(){ int a=1, b=2; printf("%4.1f/n",S(a+b));}程序运行后的输出结果是A.)14.0B.)31.5C.)7.5D.) 程序有错无输出结果

  • 查看答案
  • 有以下程序#include <stdio.h> #define S(x) (x)

    [单选题]有以下程序#include <stdio.h>#define S(x) (x)*x*2main( ){ int k=5, j=2;printf( "%d,”,s(k+j) ); printf(”%d\n”,s( (k-j) ) );}程序运行后的输出结果是A.) 98,18B.) 39,11C.) 39,18D.) 98,11

  • 查看答案
  • 有以下程序#include <stdio.h>#define P 24;#def

    [单选题]有以下程序#include <stdio.h>#define P 24;#define S(x) P*x+x;main(){ int a=2, b=2; printf("%d/n",S(a+b));}程序的运行结果是A.程序编译运行时报错,无法输出 B.54 C.96 D.100

  • 查看答案
  • 有以下程序# include <stdio.h># define N 5# de

    [单选题]有以下程序# 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

  • 查看答案
  • 有以下程序#include <stdio.h>#define f(x) x*x*

    [单选题]有以下程序#include <stdio.h>#define f(x) x*x*xmain(){ int a=3,s,t;s=f(a+1);t=f((a+1));printf("%d,%d/n",s,t);}程序运行后的输出结果是A.)10,64B.)10,10C.)64,10D.)64,64

  • 查看答案
  • 试题35有以下程序#include <stdio.h>#include <str

    [单选题]试题35有以下程序#include <stdio.h>#include <string.h>void fun(char *w,int m){ char s, *p1, *p2;p1=w; p2=w+m-1;while(p1<p2){s=*p1; *p1=*p2; *p2=s; p1++; p2- -;}}main(){ char a[]=”123456”;fun(a, strlen(a)); puts(a);}程序运行后的输出结果是()A.654321B.11661

  • 查看答案
  • 有以下程序#include <stdio.h>#define N 4void f

    [单选题]有以下程序#include <stdio.h>#define N 4void fun(int a[][N], int b[]){ int i;for(i=0;i<N;i++) b[i] = a[i][i];}main(){ int x[][N]={{1,2,3},{4},{5,6,7,8},{9,10}},y[N],i;fun(x,y);for(i=0;i<N;i++) printf("%d,",y[i]);printf("/n");}程序的运行结果是A.)1,2

  • 查看答案
  • ( 35 )有以下程序#include <stdio.h>#define SUB