Largest of Three

Lab C Beginner 10 points

Read three integers and print the largest.

Input

Three integers.

Output

The largest.

Example

Input

3 9 4

Output

9
Sample input available Sample output available
Editor
C

Hints

Assume the first is largest, then compare the others.

Solution explanation

A single statement after if doesn't need braces, but braces avoid mistakes.

Show solution
#include <stdio.h>

int main() {
    int a, b, c;
    scanf("%d %d %d", &a, &b, &c);
    int max = a;
    if (b > max) max = b;
    if (c > max) max = c;
    printf("%d\n", max);
    return 0;
}
Output
Answer
HOME LEARN COMMUNITY DASHBOARD