Mail Archives: djgpp/2001/01/08/01:02:56
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Sun, 7 Jan 2001, Pamela and Richard Groh wrote:
> To Whom It May Pertain:
>
> I am a new beginner a C++ programming and I am trying to
> create a program to perform the following equation and am
> stuck, can you give me any clues or send a similar editor
> file copy for me to compare.
>
> a times a plus b times b divided by square root
> (a*a + b*b /sqrt)
I Guess you forgot to mention divided by square root _of what_
Anyhow, try this one, assuming you want square root of a times b:
- ----<snip code>----
#include <math.h>
double myFunction(const double a, const double b)
{
double rv;
rv = (pow(a,2) + pow(b,2)) / sqrt(a * b);
return rv;
}
- ----</snip code>----
good luck !
- -- Groetjes vanwege... Greetings from... --
- -- Dieter Demerre *** ddemerre AT acm DOT org --
- -- http://www.angelfire.com/de/ddemerre/ --
-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5.8
iQA/AwUBOllVnAlG34XnM6kpEQLNqwCfTmwlrR5RtUdvdPCUMVgnWND2FR0AoMZD
cn0t9oN1b4vceIjW51akr7Lp
=ZRpU
-----END PGP SIGNATURE-----
- Raw text -