Q4 What is Conditional Compilation? how to use #if, #else and #endif directives.

#if and #else directives

Program: 148

What is Conditional Compilation? how to use #if and #else directives.

Definition:

It is a process to skip the part of a source code which depends upon expression’s return value, if it is True the block of code (#if) will be processed otherwise #else block.

Conditional Compilation (#if and #else Directives)

Example:

Output:

TEST is equal to 5.
 Good guess!
Lokesh Kumar: Being EASTER SCIENCE's founder, Lokesh Kumar wants to share his knowledge and ideas. His motive is "We assist you to choose the best", He believes in different thinking.
Related Post
Leave a Comment

This website uses cookies.