Skip to content

Instantly share code, notes, and snippets.

@ninpl
Created March 21, 2017 18:38
Show Gist options
  • Select an option

  • Save ninpl/55fcbae62e37979e61d76346e41eda4c to your computer and use it in GitHub Desktop.

Select an option

Save ninpl/55fcbae62e37979e61d76346e41eda4c to your computer and use it in GitHub Desktop.
Escribir un programa que diga si un numero entero es positivo, negativo o neutro
// Practica para refrescar la sintaxis de C++
#include <iostream>
using namespace std;
int main()
{
// Escriba un programa que diga si un numero entero es positivo, negativo o neutro
int numero;
cout<<"Ingrese el numero:";
cin>>numero;
if(numero>0)
{
cout<<"El numero es positivo"<<endl;
}
else if(numero<0)
{
cout<<"El numero es negativo"<<endl;
}
else
{
cout<<"El numero es neutro"<<endl;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment