C++ Programm Calculator Squaring
I wrote a calculator programm in C++, which is just able to square a number.
My question is how can I fix the code. Because when you compile this code and enter a floating point number, it outputs also something else. Down below is the code from my repl.
you are unconditionally parsing the number as an int and outputting the square of that at the end.(lines 38 to 40)
I suggest properly formatting your code, because right now it's messing with how easily one can follow the logic. Once you do that, it should be pretty easy to see the error.