Functions in C

  • + 0 comments

    include

    /* Add int max_of_four(int a, int b, int c, int d) here. */ int max_of_four(int a,int b,int c,int d) { int res=a>b?a:b; int res1=res>c?res:c; int res2=res1>d?res1:d; return res2; }

    int main() { int a, b, c, d; scanf("%d %d %d %d", &a, &b, &c, &d); int ans = max_of_four(a, b, c, d); printf("%d", ans);

    return 0;
    

    }