Define Macro and use it as the loop condition : Macro Constant « Macro Preprocessor « C / ANSI-C






Define Macro and use it as the loop condition

  
#include <stdio.h>

#define MAX 100

int main(void)
{
  int i;

  for( i = 0; i < MAX; i++) 
      printf("%d ", i);

  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 inside the main function
7.Define macro for string and output
8.Define marco based calculation
9.Define header file name in macro