Example:
#include <stdio.h> #define SQUARE(N) printf("Square of " #N " is = %d\n",(N*N)) #define CUBE(N) printf("Cube of " #N " is = %d\n",(N*N*N)) int main() { int number = 10; //passing variable name SQUARE(number); CUBE(number); //passing values SQUARE(10); CUBE(10); return 0; }
Output
Square of number is = 100 Cube of number is = 1000 Square of 10 is = 100 Cube of 10 is = 1000
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Example:
Output
need an explanation for this answer? contact us directly to get an explanation for this answer