Rectangle

Lab C Beginner 10 points

Read the width and height of a rectangle (integers) and print the area and perimeter.

Input

Two integers.

Output

area=A perimeter=P

Example

Input

3 4

Output

area=12 perimeter=14
Sample input available Sample output available
Editor
C

Hints

Area is w * h, perimeter is 2 * (w + h).

Solution explanation

Expressions can be calculated directly inside the printf arguments.

Show solution
#include <stdio.h>

int main() {
    int w, h;
    scanf("%d %d", &w, &h);
    printf("area=%d perimeter=%d\n", w * h, 2 * (w + h));
    return 0;
}
Output
Answer
HOME LEARN COMMUNITY DASHBOARD