Solver COMPUTE a square root of a number
Algebra
->
Square-cubic-other-roots
-> Solver COMPUTE a square root of a number
Log On
Algebra: Square root, cubic root, N-th root
Section
Solvers
Solvers
Lessons
Lessons
Answers archive
Answers
Source code of 'COMPUTE a square root of a number'
This Solver (COMPUTE a square root of a number)
was created by by
ichudov(507)
:
View Source
,
Show
,
Put on YOUR site
About ichudov
:
I am not a paid tutor, I am the owner of this web site!
==section input Compute a square root of *[input a=9]. ==section solution perl if( $a < 0 ) { print "<FONT COLOR=RED>You made a mistake in wanting to compute {{{ sqrt( $a ) }}}. Square root is only defined for positive values inside the root symbol."; return; } $r = sqrt( $a ); print " {{{$r = sqrt( $a )}}} "; ==section output r ==section check a=9 r=3 ==section practice perl my $x = randint( 2,9 ); $a = $x*$x;