Answer to Question #295814 in C for Harsh

Question #295814

Pass your marks of CA-1, CA-2, and CA-3, of course, INT102 to the function with header high


(float, float, float). Write a function that should return the highest CA mark

1
Expert's answer
2022-02-09T15:56:11-0500
#include <stdio.h>


float high(float m1, float m2, float m3) {
    float h;


    if (m1 > m2)
        h = m1;
    else 
        h = m2;
    
    if (m3 > h)
        h = m3;
    
    return h;
}


int main() {
    float ca1, ca2, ca3;


    ca1 = 50;
    ca2 = 65;
    ca3 = 60;


    printf("The highst CA mark is %.1f\n", high(ca1, ca2, ca3));


    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS