#include <iostream>
using namespace std;
template <class T>
class base
{
    T a;
    public:
    base (T b)
    {
        a=b;
    }
    void dis()
    {
        cout<<"\n The value is : "<<a;
    }
};
int main()
{
    base <int> obj1(100);
    obj1.dis();
    base <float> obj2(20.8);
    obj2.dis();
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: