Question: Write a function int max_of_four(int* a, int* b, int* c, int* d) which reads four pointer arguments and returns the greatest of the values pointed

Write a function int max_of_four(int* a, int* b, int* c, int* d) which reads four pointer arguments and returns the greatest of the values pointed by them.

Input Format

Input will contain four pointers to integers - , one in each line.

Output Format

Print the greatest of the four integers. PS: I/O will be automatically handled.

Sample Input

3

4

6

5

Sample Output

6

#include

#include

using namespace std;

/*

Add `int max_of_four(int* a, int* b, int* c, int* d)` here.

*/

int main() {

int *a, *b, *c, *d;

scanf("%d %d %d %d", what should we put here);

int ans = max_of_four(what should we put here);

printf("%d", ans);

return 0;

}

Use Visual Studio to type-up the code

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!