Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Analysis Using SQL And Excel

Authors: Gordon S Linoff

2nd Edition

111902143X, 9781119021438

More Books

Students also viewed these Databases questions