Preloader
PseInt
  • Estimated reading time: 1 Minute

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 ❤️!

Related articles
How to resolve PseInt exception: ERROR 273 Debe haber un Proceso
10 Apr, 2021
  • Estimated reading time: 2 Minutes
How to print the first N numbers of the Fibonacci series in PseInt
20 Oct, 2020
  • Estimated reading time: 1 Minute
How to print the border of an empty square with asterisks in PseInt
20 Oct, 2020
  • Estimated reading time: 1 Minute
How to print the first N multiples of a number in PseInt
20 Oct, 2020
  • Estimated reading time: 1 Minute
Weekly trending
The Hidden Costs of NOT Having Managed IT Services
19 Jun, 2026
  • Estimated reading time: 10 Minutes
How Professional Electricians Help Protect Your Home and Family
19 Jun, 2026
  • Estimated reading time: 5 Minutes
How AI Identifies Antiques From Photos
19 Jun, 2026
  • Estimated reading time: 14 Minutes
Our Sponsors

Our blog is proudly supported by industry-leading sponsors.