#include<iostream.h>
#include<conio.h>
template <class T>
class demo
{
                T a;
public:
                demo(T ch)
                                {
                                a=ch;
                                }
                void display(T b)
                                {
                                cout<<"A = "<<a<<"\tB = "<<b<<endl;
                                }
};
void main()
{
                clrscr();
                demo <char> x('V');
                demo <int> y(10);
                demo <double> z(15.13);
                x.display('K');
                y.display(20);
                z.display(25.67);
                getch();
}

206.PNG

Advertisements