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.
#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;
}
Comments
Leave a comment