Example 54: Area and Perimeter
Write macro definitions with arguments for calculation of the area and perimeter of a triangle, square, and circle.
Store these macro definitions in a file called
areaperi.h. Include this file in your program, and call the macro definitions for calculating the area and perimeter for a square, triangle, and circle.
Given below is our recommended way to approach this problem.