Created
March 21, 2017 18:38
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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