Sum of Numbers

#include <iostream>
using namespace std;
template <class T>
  T sum(T n1, T n2)
{
  return n1+n2;
}
int main() {
float a,b,c,d;
  cin>>a>>b>>c>>d;
  cout<<sum(a,b)<<endl<<sum(c,d)<<endl<<sum(a,c);
return 0;
}

2 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. #include
    using namespace std;
    template
    void min(T n1,T n2,T n3)
    {
    if(n1>a>>b>>c;
    min(a,b,c);
    return 0;
    }

    ReplyDelete