Q:

The #if directive Example in C | C preprocessor programs

belongs to collection: C Preprocessors Programs

0

The #if directive Example in C | C preprocessor programs

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Example:

#include <stdio.h>

#define MAX_GF 100

int main(){
	
	printf("Hello\n");
	#if MAX_GF>=50
		printf("Wau, you may have more than 50 girlfriends\n");
		printf("Code for more than 50 GFs\n");
	#endif
	printf("Bye!\n");
	
	return 0;
}

Output

    Hello
    Wau, you may have more than 50 girlfriends
    Code for more than 50 GFs
    Bye!

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
The #if ... #else directive Example in C | C prepr... >>