63 052
Assignments Done
99,1%
Successfully Done
In July 2018

Answer to Question #46609 in C++ for amanda shaffer

Question #46609
Write a fuction template Square() that returns the square of its only argument.
Expert's answer
//Question #46609, Programming, C++
#include <iostream>
using namespace std;
template<class T>
T Square(T a) {
return a*a;
}
int main() {
int a = 3;
cout << Square(a);
system("pause");
return 0;
}


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions