text: /*
  @@@@ PROGRAM NAME: knkcch14e06.c
  @@@@ FLAGS: -std=c99
  @@@@ PROGRAM STATEMENT: 
  (a) Write a macro DISP(f,x) that expands into a call of printf that displays the value
  of the function f when called with argument x. For example.
  
  	DISP(sqrt, 3.0);
  
  should expand into
  
  	printf ("sqrt(%g) = %g\n", 3.0, sqrt(3.0));
  
  (b) Write a macro DISP2(f,x,y) that’s similar to DISP but works for functions with
  two arguments.
  */
  #include<stdio.h>
  #include<math.h>
  //---------------------------------------------------------------------------
  #define DISP(f,x) (printf(#f"(%g) = %g\n",(x),f(x)))
  #define DISP2(f,x,y) (printf(#f"(%d, %d) = %d\n",(x),(y),f((x),(y))))
  //---------------------------------------------------------------------------
  int sum(int x,int y)
  {
  	return x+y;
  }
  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  //------------------------START OF MAIN()--------------------------------------
  int main(void)
  {
  	printf("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
  	
  	int x=26,y=6;
  	double d=26.00;
  
  	DISP(sqrt,d);
  	DISP2(sum,x,y);
  	
  	printf("\n++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
  	return 0;
  }
  //-------------------------END OF MAIN()---------------------------------------
  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  /*
  OUTPUT:
  @@@@ Trial1:
  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  sqrt(26) = 5.09902
  sum(26, 6) = 32
  
  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  @@@@ Trial2:
  @@@@ Trial3:
  @@@@ Trial4:
  @@@@ Trial5:
  @@@@ Trial6:
  @@@@ Trial7:
  @@@@ Trial8:
  @@@@ Trial9:
  */
  //---------------------------------------------------------------------------