How to determine if a number is positive or negative in PseInt

In PseInt 2019 it is possible to check if a number is positive or negative, simply by using a conditional that checks if the number is greater than 0. In case the number is greater than 0, the number is positive, otherwise the number is negative.

The following algorithm allows the reading of an integer variable called num the integer type. The user enters the number and according to the sign it will print if it is negative or positive:

Algoritmo TestSignos
	Definir num Como Entero
	
	Escribir "Ingresa el numero a determinar"
	Leer num
	
	Si num > 0 Entonces
		Escribir "El numero es positivo"
	SiNo
		Escribir "El numero es negativo"
	FinSi
FinAlgoritmo

Que te diviertas ❤️!

This could interest you

Become a more social person