SQRT HELP
Author |
Message |
notleetprogrammer
|
Posted: Sat Jun 10, 2006 2:54 pm Post subject: SQRT HELP |
|
|
WHY WONT THIS LET ME SQRT.....WOOOOOOOW code: | var angle, side1, side2, hyp, answer : real
var side, name : string
put "Enter the side name..."
get name
if name = "hyp" then
put "Enter hyp value."
get hyp
end if
put "Enter side value..."
get side1
put "Enter second side value..."
get side2
if name = "hyp" then
answer := hyp ** 2 - side1 ** 2
sqrt(answer)
put answer
end if |
|
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Dan
![](http://wiki.compsci.ca/images/archive/3/3c/20100325043407!Danspic.gif)
|
Posted: Sat Jun 10, 2006 3:04 pm Post subject: (No subject) |
|
|
the sqrt function returns a value and dose not chage the value passed to it.
Quote:
sqrt ( r : real ) : real
So if you whont to put the sqrt of answer in answer you have to do:
code: |
answer := sqrt(answer)
|
|
Computer Science Canada
Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more! |
|
|
|
![](images/spacer.gif) |
notleetprogrammer
|
Posted: Sat Jun 10, 2006 3:25 pm Post subject: (No subject) |
|
|
thnx man |
|
|
|
|
![](images/spacer.gif) |
|
|