Macros with Arguments

Lab C Intermediate 20 points

Define #define SQUARE(x) ((x) * (x)) and #define MAX(a, b) ((a) > (b) ? (a) : (b)). Read two numbers and print SQUARE(a + 1) and MAX(a, b).

Input

Two integers.

Output

Two lines.

Example

Input

3 8

Output

16
8
Sample input available Sample output available
Editor
C

Hints

Wrap every macro argument in parentheses.

Solution explanation

Without the parentheses, SQUARE(a + 1) would expand to a + 1 * a + 1.

Show solution
#include <stdio.h>
#define SQUARE(x) ((x) * (x))
#define MAX(a, b) ((a) > (b) ? (a) : (b))

int main() {
    int a, b;
    scanf("%d %d", &a, &b);
    printf("%d\n%d\n", SQUARE(a + 1), MAX(a, b));
    return 0;
}
Output
Answer
HOME LEARN COMMUNITY DASHBOARD