Write a C++ program to find maximum of two numbers using a function. The function should input two values and return the maximum of the two.
#include<iostream>
using namespace std;
int max(int a,int b){
if(a>b)return a;
else return b;
}
int main(){
int a,b,c;
cout<<"Enter two numbers "<<endl;
cout<<"a : ";
cin>>a;
cout<<"b : ";
cin>>b;
c = max(a,b);
cout<<"Maximum value is "<<c<<endl;
return 0;
}
