You are on page 1of 1

#include<iostream>

#include<conio.h>

using namespace std;

template <class T>

T sumofvalues(T r,T t)

{ T sum;

sum=r+t;

return (sum);

int main()

int a,b;

float c,d;

cout<<"Give me 2 numbers in Integer and float"<<endl;

cin>>a>>b;

cin>>c>>d;

getch();

cout<<"The sum of your two values is"<<"--------"<<sumofvalues(a,b)<<endl;

cout<<"The sum of your two float values is"<<"--------"<<sumofvalues(c,d)<<endl;

getch();

return 0;

You might also like