Functions in C

  • + 0 comments

    Here is my version of solution using ternary operator

    int max_of_four(int a,int b,int c,int d) {

     int largest;
    
        largest= (a>=b && a>=c && a>=d)?a: (b>=c && b>=d)?b: (c>=d)?c:d;
    
        return largest;
    

    }