Operators and Macros
Exercises
- Use a macro to calculate the area and circumference of a circle.
- Use macros to calculate the square and cube of a number.
- Check whether a number is even or odd using the remainder operator.
- Swap two numbers without a temporary variable.
Concepts practiced
#define, arithmetic operators, assignment, and operator precedence.
Click here for explanation and solution.