cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
How do i write this equation for C++?
How do i write this equation for C++?
Sep 29, 2014 at 2:41am UTC
banithel
(24)
BMI = 703*weight / height^2
how i thought to write it was:
(703 * getWeight / pow(getWeight, 2.0)
which is wrong.
Any help with this would be great please.
Sep 29, 2014 at 2:46am UTC
liuyang
(217)
getWeight, is that a method?
And you're using getWeight for both weight and height?!
Sep 29, 2014 at 2:52am UTC
banithel
(24)
Sorry for the typo it should be
(703 * getWeight / pow(getHeight, 2.0)
And both getWeight and getHeight are variables for entering in the console.
(I am in intro to C++ class and dont get the equations)
Sep 29, 2014 at 2:57am UTC
banithel
(24)
Ok, that acually works now, I had it actually written as above with getWeight twice, thanks for pointing that out liuyang
Topic archived. No new replies allowed.