Write a program of defining macros without value


 

/* Write a program of defining macros without value. */

#include<iostream.h>

#include<conio.h>

#define MACRO1

#define MACRO2

int main(void)

{

clrscr();

#ifdef MACRO1

cout<<“MACRO1 defined”;

#endif

#ifdef MACRO2

cout<<” MACRO2 defined\t”;

#endif

return(0);

}

output:

MACRO1 defined MACRO2 defined

Related Posts

Comments are closed.