T absolute(T val)
{ if (val < 0)="" return="" val="" *="" (-1);="" return="" val;="">
void integer_call(int &x1, int &x2, int &x1_holding, int &x2_holding);
void double_call(double &y1, double &y2, double &y1_holding, double &y2_holding);
int main()
{
cout < fixed="">< showpoint=""><>
do
{
cout <>
cout < "\tabsolute="" value="" template"=""><>
cout < "1)="" to="" test="" integers="" press="" 1."=""><>
cout < "2)="" to="" test="" doubles="" press="" 2."=""><>
cout < "0)="" to="" quit"=""><>
char option[20]; cin >> option;
switch (atoi(option))
{
case 1: integer_call(); break;
case 2: double_call(); break;
default: exit(0);
}
}
while (true);
cout <>
system("pause");
return 0;
void integer_call(int &x1, int &x2, int &x1_holding, int &x2_holding)
{
cout < "please="" enter="" the="" 1st="" number="" as="" an="" integer:="">
cin >> x1;
cout < "please="" enter="" the="" 2nd="" number="" as="" an="" integer:="">
cin >> x2;
x1_holding = absolute(x1);
cout < "\nabsolute="" value="" of="" 1st="" number="" "="">< x1="">< "="" is:="" "="">< x1_holding=""><>
x2_holding = absolute(x2);
cout < "absolute="" value="" of="" 2nd="" number="" "="">< x2="">< "="" is:="" "="">< x2_holding=""><>
}
void double_call(double &y1, double &y2, double y1_holding, double y2_holding)
{
cout < "please="" enter="" the="" 1st="" number="" as="" a="" double:="">
cin >> y1;
cout < "please="" enter="" the="" 2nd="" number="" as="" a="" double:="">
cin >> y2;
y1_holding = absolute(y1);
cout < "\nabsolute="" value="" of="" 1st="" number="" "="">< y1="">< "="" is:="" "="">< y1_holding=""><>
y2_holding = absolute(y2);
cout < "\nabsolute="" value="" of="" 2nd="" number="" "="">< y2="">< "="" is:="" "="">< y2_holding=""><>
}