Advertisement
idsystems

CPP_Practica37 - Positivo Negativo

Jan 30th, 2012
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. // Program: pnz.cc
  2. // Author:  Yoan Pinzon
  3. // Date:    Agosto 30, 2006
  4.  
  5. #include <iostream>
  6.  
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11.    int x;
  12.  
  13.    cout << "Positivo, Negativo o Zero" << endl;
  14.    cout << "=========================" << endl;
  15.    
  16.    cout << "Entre un numero = "; cin >> x;
  17.  
  18.    if( x > 0 )
  19.    {
  20.       cout << "El numero " << x << " es positivo" << endl;
  21.    }
  22.    else
  23.    {
  24.       if( x < 0 )
  25.       {
  26.          cout << "El numero " << x << " es negativo" << endl;
  27.       }
  28.       else
  29.       {
  30.          cout << "El numero " << x << " es zero" << endl;
  31.       }
  32.    }
  33.  
  34.    return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement