-
Language
PSeInt (Pseudocode)
-
Description
It determines the square root if the entered value is a positive number. If the value is a negative value it says that it is an imaginary solution.
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
Proceso SquareRoot
Escribir Sin Saltar "Enter the value of a number:";
Leer a_number;
Si a_number>=0 Entonces
square_root <- RC(a_number);
Escribir "Real root";
SiNo
square_root <- RC(-a_number);
Escribir "Imaginary root";
FinSi
Escribir "Value of square root: ", square_root;
FinProceso
Escribir Sin Saltar "Enter the value of a number:";
Leer a_number;
Si a_number>=0 Entonces
square_root <- RC(a_number);
Escribir "Real root";
SiNo
square_root <- RC(-a_number);
Escribir "Imaginary root";
FinSi
Escribir "Value of square root: ", square_root;
FinProceso