1. Engineering
  2. Computer Science
  3. a write a macro dispf x that expands into a...

Question: a write a macro dispf x that expands into a...

Question details





(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) i should expand into print f(sqrt(%g) %g\n, 3.0, sqrt (3.0)); (b) Write a macro DISP2 (f,x,y) thats similar to DISP but works for functions with two arguments. Please embed the two macros in a simple test program
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution