• + 0 comments

    Using ranged for loop

    int max_of_four(int a, int b, int c, int d){
        int values[] = {a,b,c,d};
        int largest=a;
        for (int i: values){
            if (largest<i){
                largest=i;
            }
            i++;
        }
        return largest;
        
    }