Create a standard non-template class `MathOp`. Inside it, define a member function template `template T square(T val)` that returns `val * val`. Read a float from input, call `square()` using the `MathOp` object, and print ‘Result: [val]’.
A single float.
Print the formatted result.
None
1.5
Result: 2.25
You don't need to make the entire class a template. Individual methods inside regular classes can be templated.
#include <iostream>
class MathOp {
public:
// Define template member function square() here
};
int main() {
// Instantiate MathOp, read float, and print square
return 0;
}Embedded systems rely on efficient low-level programming to interact directly with hardware. In this course, you will learn how to write practical Embedded C programs used in real microcontroller-based systems. Rather than focusing only on theory, this course follows a practice-driven approach. Each lesson includes hands-on coding exercises that simulate real firmware development tasks used