Problem Statement: Write a program for the multiplication of two numbers using the template function.
Note:- Scroll horizontally to see the full line of code.
#include<iostream>
using namespace std;
template<typename T>
void multiply(T a, T b){
cout<<"Multiplication is:"<<a*b<<endl;
}
int main(){
int a,b;
cout<<"Please Enter Numbers:";
cin>>a>>b;
multiply(a,b);
return 0;
}
Comments
Post a Comment