Define marco based calculation : Macro Constant « Macro Preprocessor « C / ANSI-C






Define marco based calculation

  
#include <stdio.h>

#define SMALL 1
#define MEDIUM SMALL+1
#define LARGE MEDIUM+1

int main(void)
{
  printf("%d %d %d", SMALL, MEDIUM, LARGE);

  return 0;
}


           
       








Related examples in the same category

1.Use Macro
2.Define Macro: TRUE and FAlSE
3.Define macro: constant
4.Define constant in Macro for loop controlDefine constant in Macro for loop control
5.Define constant in MacroDefine constant in Macro
6.Define Macro and use it as the loop condition
7.Define macro inside the main function
8.Define macro for string and output
9.Define header file name in macro