I need to write a program using a function to output the max of 3 integers. This is what i have so far but i cant figure out whats wrong with the program. Thanks.
#include <iostream>
usingnamespace std;
int main () {
int a, b, c;
int maximum;
cout << "Input 3 numbers to find the max number: " << endl;
cin >> a, b, c;
maximum=max(a, b, c);
cout << "The largest integer is " << maximum << endl;
return 0;
}
int max (int a, int b, int c) {
if ((c<b) && (c<a)) {
if ((a>b) cout << a;
else cout << b;}
else cout << c;}