Example 53: Write Macro Definitions

Learn how to write and use macro definitions.

We'll cover the following

Problem

Write down macro definitions for the following and use them from main():

  1. To test whether a character is in lower case or not

  2. To test whether a character is in upper case or not

  3. To test whether a character is an alphabet or not

    Make use of the macros you defined in 1 and 2 above.

  4. To obtain the bigger of the two numbers

Solution

Given below is our recommended way to approach this problem.

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.