Recommended Answers
Jump to PostIf we could see a bit more of your code?
Jump to PostAre variable a, b, c, s all integer types?
What is the exact error message?
sqrt( ) requires an argument that is a floating point type. Typecasting will be needed if your args are all integer types.
Jump to PostIf you include <cmath> sqrt function lives in std namespace. So declare
using namespace std;
or (better) use std::sqrt(...) or declareusing std::sqrt;
.
Probably, that's all your troubles now...
Jump to PostI don't think that <cmath> is in std namespace:
Example with iostream (using namespace std;)Example with cmath (doesn't have using...)
Maybe he declared another function named sqrt? Or a variable perhaps.
All 14 Replies
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.