#include <stdio.h>
#define NUM 100
int main()
{
//checking a defined Macro
#ifdef NUM
printf("Macro NUM is defined, and its value is %d\n",NUM);
#else
printf("Macro NUM is not defined\n");
#endif
//checking an undefined Macro
#ifdef MAX
printf("Macro MAX is defined, and its value is %d\n",MAX);
#else
printf("Macro MAX is not defined\n");
#endif
return 0;
}
Output
Macro NUM is defined, and its value is 100
Macro MAX is not defined
Example:
Output
need an explanation for this answer? contact us directly to get an explanation for this answer