Define a function like Macro that should use printf in C | C preprocessor programs
We can use printf() function in a Macro. In this example, we are creating a function like Macro that will print the result of a calculation, like adding two numbers.
Macro definition:
#define SUM(a,b) (printf("SUM of %d and %d is = %d\n", a, b, a+b))
Example:
Output
need an explanation for this answer? contact us directly to get an explanation for this answer