Skip to content

Instantly share code, notes, and snippets.

@LokeshKumarES
Created December 19, 2021 12:46
Show Gist options
  • Save LokeshKumarES/f037a4fe8a379535b0bc381f1f451f20 to your computer and use it in GitHub Desktop.
Save LokeshKumarES/f037a4fe8a379535b0bc381f1f451f20 to your computer and use it in GitHub Desktop.
Conditional Compilation: (#if and #else directives). The block of code will be processed based on expression result.
#include<stdio.h>
# define TEST 5
int main(){
# if TEST < 5
printf("TEST is smaller than 5.");
# elif TEST == 5
printf("TEST is equal to 5.");
# else
printf("TEST is greater than 5.");
# endif // TEST
printf("\n Good guess!");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment