ALGORITMO QUE MUESTRA SI ES NÚMERO ES POSITIVO O NEGATIVO

Categoría de Estructura Condicional Simple


Algoritmo para determinar si un numero es positivo o negativo

💻 Hacer un programa dónde se ingrese un número entero y muestre si es un número positivo o negativo, considerar 0 como positivo.


Algoritmo en pseint que muestra número positivo o negativo PSeInt Estricto : DESCARGA EL CÓDIGO

algoritmo que muestra número positivo o negativo

Algoritmo en pseint - short youtube
Algoritmo programacion_work 
    Definir num como Entero;		
    Escribir "06. MUESTRA NÚMERO POSITIVO O NEGATIVO";
    Escribir Sin Saltar "INGRESE NÚMERO : ";
    Leer num;
    Escribir "";
    Si (num >= 0) Entonces
        Escribir "NÚMERO POSITIVO";
    SiNo
        Escribir "NÚMERO NEGATIVO";
    FinSi
FinAlgoritmo
número positivo o negativo en pseint

código en python que muestra si es un número negativo o positivo Python :

print("06. MUESTRA NÚMERO POSITIVO o NEGATIVO")
num = int(input("INGRESE CANTIDAD : "))
if num >= 0:
    print("NÚMERO POSITIVO")
else:
    print("NÚMERO NEGATIVO")

código en Lenguaje C que muestra si un número es positivo o negativo Lenguaje C :

#include<stdio.h>
int main() {
    int num;
    printf("06. MUESTRA SI ES UN NUMERO POSITIVO O NEGATIVO.\n\n");
    printf("INGRESE NUMERO : ");
    scanf("%d",&num); 
    if(num >= 0){
        printf("\nNUMERO POSITIVO");
    }else{
        printf("\nNUMERO NEGATIVO");
    }        
    return 0;
}

código en Dev C++ que muestra valor positivo o negativo Dev C++ :

#include<iostream>
using namespace std;
int main() {
    int num;
    cout << "06. MUESTRA SI ES UN NÚMERO POSITIVO O NEGATIVO.\n\n"; 
    cout << "INGRESE NUMERO : ";
    cin << num;	
    cout << endl;
    if(num >= 0){
        cout << "NUMERO POSITIVO" << endl;
    }else{
        cout << "NUMERO NEGATIVO" << endl;
    }	
    return 0;
}

Programar en Java NetBeans que muestra número positivo o número negativo Java NetBeans :

package programacion_work;
import java.util.Scanner;
public class positivo_negativo {
    public static void main(String[] args) {
        // MUESTRA NÚMERO POSITIVO O NEGATIVO
        int num;  
        Scanner ingreso=new Scanner(System.in);
        System.out.print("INGRESE NUMERO : ");
        num = Integer.parseInt(ingreso.next());          
        if(num >= 0){
            System.out.println("NUMERO POSITIVO");
        }else{
            System.out.println("NUMERO NEGATIVO");
        }         
    }  
}



Facebook de www.programacion.work. Canal de Youtube de www.programacion.work. Twitter de www.programacion.work. TikTok de www.programacion.work.


Política de cookies

Política de Privacidad

Aviso Legal y Términos De Uso