home *** CD-ROM | disk | FTP | other *** search
/ World of A1200 / World_Of_A1200.iso / datafiles / text / c_tutor / define.c < prev    next >
C/C++ Source or Header  |  1995-02-27  |  427b  |  17 lines

  1. #define START  0  /* Starting point of loop */
  2. #define ENDING 9  /* Ending point of loop */
  3. #define MAX(A,B)  ((A)>(B)?(A):(B))  /* Max macro definition */
  4. #define MIN(A,B)  ((A)>(B)?(B):(A))  /* Min macro definition */ 
  5.  
  6. main()
  7. {
  8. int index,mn,mx;
  9. int count = 5;
  10.  
  11.    for (index = START;index <= ENDING;index++) {
  12.       mx = MAX(index,count);
  13.       mn = MIN(index,count);
  14.       printf("Max is %d and min is %d\n",mx,mn);
  15.    }
  16. }
  17.