The below program is more important in lab as well as interview. This program will explain you how to add two numbers using function in C++. Try to write a program and find out the answer. I have given answer for this program here.
Addition of two Numbers using Function Template
T add(T m,T n)
cout<<“Enter the two integer values”;
cout<<“Enter two float values”;
cout<<“The Addition of integer numbers:”<<add(a,b);
cout<<“The Addition of float numbers:”<<add(x,y);
Enter the two integer values
Enter two float values
The Addition of integer numbers:100
The Addition of float numbers: 50
All the best!!!