# | Problem | Pass Rate (passed user / total user) |
---|---|---|
14651 | Compute rectangle perimeter and area |
|
14653 | Find the maximum of three integers |
|
Description
Write a C program to compute the perimeter and area of a rectangle with inputted height and width.
Input
Two integer numbers, width and height.
Output
Two integer numbers, perimeter and area
Ensure that the output, including formatting, exactly matches the provided samples.
Sample Input Download
Sample Output Download
Discuss
Description
Write a C program that accepts three integers and finds the maximum of three.
Note that you can use "comparision" operator to do this exercise. However, it is suggested to use the following format instead:
Assume x, y and z are three inputted integers:
-
temp = (x + y + abs(x - y)) / 2;
-
max = (temp + z + abs(temp - z)) / 2;
Note that abs
here stands for the absolute value. Also, in order to use abs function, you have to include <stdlib.h> first.
Input
Three input integers
Output
The maximum of the inuput integers.
Ensure that the output, including formatting, exactly matches the provided samples.