Addition of All

Description:

Write a program to add numbers and strings by overloading the function add.Addition should include integers,float and strings. Input : First line contains two integers. Second line contains two floating point numbers. Third line contains two strings Test Case 1 Input (stdin) 5 5 1.2 1.2 hello world Expected Output Sum of integers=10 Sum of floats=2.4 Sum of strings=helloworld Test Case 2 Input (stdin) 9 9 6.53 6.53 hola hacker Expected Output Sum of integers=18 Sum of floats=13.06 Sum of strings=holahacker

Program :

#include <iostream>

using namespace std;

int main()

{

int a,b;

  float c,d;

  char e[50],f[50];

  cin>>a>>b>>c>>d>>e>>f;

  cout<<"Sum of integers="<<a+b<<endl;

  cout<<"Sum of floats="<<c+d<<endl;

  cout<<"Sum of strings="<<e<<f;

return 0;

}