Average of Three

Lab C Beginner 10 points

Read three integers and print their average with 2 decimals.

Input

Three integers.

Output

The average.

Example

Input

1 2 4

Output

2.33
Sample input available Sample output available
Editor
C

Hints

Divide by 3.0, not 3, to get a decimal result.

Solution explanation

One double operand is enough to make the division a floating-point division.

Show solution
#include <stdio.h>

int main() {
    int a, b, c;
    scanf("%d %d %d", &a, &b, &c);
    printf("%.2f\n", (a + b + c) / 3.0);
    return 0;
}
Output
Answer
HOME LEARN COMMUNITY DASHBOARD