- 3
Help me in C++
#include <iostream> using namespace std ; template <typename T > T add ( T a , T b ) { return a + b ; } int main () { int i = 1; double z = 1; float x =1; cout << add ( i , i ) << " \n " ; cout << add ( z,z) << " \n " ; cout << add ( x , x ) << " \n " ; return 0 ; } this code is it correct ?
1 Answer
+ 4
Yes this is correct đŻ