Answer to Question #293940 in C++ for Varun Dogra

Question #293940

Pass your marks of CA-1(28), CA-2(27), and CA-3(0) of course INT102 to the function with header high (float *, float *, float*). Write a function that should return the highest CA marks.


1
Expert's answer
2022-02-04T07:59:11-0500
#include <iostream>
using namespace std;

float high(float* m1, float* m2, float* m3) {
    if (*m1 >= *m2 && *m1 >= *m3)
        return *m1;
    if (*m2 >= *m1 && *m2 >= *m3)
        return *m2;
    return *m3;
} 


int main() {
    float CA1=28, CA2=27, CA3=0;

    cout << "The highest CA marks is " << high(&CA1, &CA2, &CA3) << endl;

    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