no instance of function templatemaximum* matches the argument list argument types are: (int,int,int)*

``````#include <iostream>
using namespace std;

template <class T>
T maximum(T value)
{
T maxValue;
if (value >= maxValue)
maxValue = value;
else
value = value;
return value;
}
int main()
{
int number1 = 1;
int number2 = 2;
int number3 = 3;
//double n1 = 1.11;
//double n2 = 2.22;
//double n3 = 3.33;
cout << " Max integer value is :" << maximum(number1, number2, number3) << endl;
return 0;
}
``````

your function has only one parameter `maximum(T value)`
change it to `maximum(T value1, T value2, T value3)`

This isn't really a problem of templates, it's just the problem that you don't have a function named `maximum` that could take 3 values. Your maximum function template can only take a single value (not to mention that that function is not going to work at anything, because it has obvious errors in it).

If you need a maximum function that takes three values, you need to define one that takes three values:

``````template <typename T>
T maximum(T v1, T v2, T v3) {
//.. code here..
};
``````

I was trying to make it look something like this

``````template <class T> // template prefix
T abs(T value) // header line
{
T absnum; // variable declaration
if (value < 0)
absnum = -value;
else
absnum = value;
return absnum;
}
int main()
{
int num1 = -4;
float num2 = -4.23f;
double num3 = -4.23456;
cout << "The absolute value of " << num1
<< " is " << abs(num1) << endl;
cout << "The absolute value of " << num2
<< " is " << abs(num2) << endl;
cout << "The absolute value of " << num3
<< " is " << abs(num3) << endl;
return 0;
}
``````

You can't only pass one value to a function to find maximum value between some values!!!!
firstly make a function to take three parameters next compare value1 and value2 then compare it to the third one

``````#include <iostream>
using namespace std;

template <class T>
T maximum(T value1,T value2, T value3)
{
T maxValue =0;
if (value1 >= maxValue)
maxValue = value1;
else if (value2 >= value1)
maxValue = value2;
else if (value3 >= value2)
maxValue = value3;
return maxValue;
}
int main()
{
int number1 = 1;
int number2 = 2;
int number3 = 3;
//double n1 = 1.11;
//double n2 = 2.22;
//double n3 = 3.33;
cout << " Max integer value is :" << maximum(number1, number2, number3) << endl;
char aaa;
cin >> aaa;
return 0;
``````

Why doesn't this work?

becuase it wrong :-D
line 7 why compare between value1 and maxvalue?

``````if(condition)
{
if(condition)
statment...
else
statment...
}
else
{
if(condition)
statement...
else
statment...
}
``````