Use macro in calculation : Macro Basic « Macro Preprocessor « C / ANSI-C






Use macro in calculation

#include <stdio.h>

#define Var1      7
#define Var2       5
#define Var3       Var1 + Var2

int main() {
    printf("The square of all the parts is %d\n",
  Var3 * Var3);
    return (0);
}


           
       








Related examples in the same category

1.Check if a macro has been defined
2.Macro in different file