Different types of macro calling with proper example in C


 #include<stdio.h>

#define sum(num1, num2) num1 + num2//Macro Definition

#define multiplication(num1, num2, num3) num1 * num2 * num3

#define maximum(a, b) a>b?a:b

#define square(a) a * a

int main()

{

        int res = 64/square(4);

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

        return 0;

}





No comments:

Post a Comment