| #include<iostream.h> template <class myclass> void showabs( myclass x ) { if (x<0) x = -x ; cout << " The absolute value of the number is "<< x <<endl; } void main() { int num1 = -4; long num2 = -987654; double num3 = -1.234567; showabs(num1); showabs(num2); showabs(num3); } |