template
class sum
{
T a,b,c;
public:
sum(T x,T y)
{
a=x;
b=y;
}
void read(T p,T q)
{
a=p;
b=q;
}
void read(T p,T q)
{
a=p;
b=q;
}
void display()
{
c=a+b;
cout<<"sum ="<
};
void main()
{
sum
sum
sum
o1.display();
o2.display();
o3.display();
}
OUTPUT :
sum =30
sum =5.5
sum =7
No comments:
Post a Comment