Answer to Question #194288 in C++ for KAVIN MUKILAN

Question #194288

Design a class template with overloaded operator / to perform a = b / c.


1
Expert's answer
2021-05-17T06:31:20-0400
include <iostream>
#include <conio.h>
using namespace std;

template<class t1,class t2>
void sum(t1 a,t2 b) // defining template function
{
    cout<<"Div="<<a/b<<endl;
}

int main()
{
    int a,b;
    float x,y;
    cout<<"Enter two integer data: ";
    cin>>a>>b;
    cout<<"Enter two float data: ";
    cin>>x>>y;
    Div(a,b); // dividing two integer type data
    getch();
    return 0;
}
 
    

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS