Home » Programming Languages » C Programs » If elif in C

If elif in C

#include <stdio.h>

#define MACRO 3

int main(void) {

#if MACRO == 5
	printf("Macro is currently set to 5\n");
#elif MACRO == 4
	printf("Macro is currently set to 4\n");
#else
	printf("Macro is something else\n");
#endif

	return 0;
}
	
C#-S-5: if-else condition
C#-S-5: if-else condition

Leave a Comment