Home » Programming Languages » C Programs » If else endif in C

If else endif in C

#include <stdio.h>

#define MACRO 4

int main(void) {
	int a = 5;

// Note: here you can't compare a macro with variable
// hence #if MACRO == a
// this statement will not work.

#if MACRO == 5
	printf("Macro value matches with a\n");
	printf("Macro value doesnt match with a\n");

	return 0;

Subscribe our Rurban Life YouTube Channel.. "Rural Life, Urban LifeStyle"

Leave a Comment