28th Dec 2020, 12:28 PM
Arash
Arash - avatar
2 Answers
+ 1
you need to include math.h to use sqrt #include<math.h>
28th Dec 2020, 1:16 PM
Bahha┣
Bahha┣ - avatar
+ 1
As mentioned, you need to include math.h #include <math.h> at the top of your file. However the way you currently implement the square root case won't work, as the √ is outside the range the type char can handle. Another thing: It's bad practice to put the default case somewhere in the middle of your switch, always try to put it at the end unless you have a good reason not to.
28th Dec 2020, 1:21 PM
Paul Grasser
Paul Grasser - avatar