jfcmacro

tiposelem.cpp

Mar 15th, 2019
331
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.11 KB | None | 0 0
  1. /*
  2.  * fichero: tiposelem.cpp
  3.  *
  4.  * proposito: mostrar la declaracion de variables globales
  5.  *
  6.  * compilar: $ g++ -o tiposelem tiposelem.cpp
  7.  *           $ make tiposelem
  8.  * ejecutar: $ ./tiposelem5
  9.  */
  10. #include <iostream>
  11. #include <limits>
  12.  
  13. using namespace std;
  14.  
  15. int
  16. main(void) {
  17.  
  18.   cout << "valor minimo booleano: "
  19.        << numeric_limits<bool>::min()
  20.        << " valor maximo booleano: "
  21.        << numeric_limits<bool>::max()
  22.        << " numero bytes: "
  23.        << sizeof(bool)
  24.        << endl;
  25.    
  26.   cout << "valor minimo caracter: "
  27.        << numeric_limits<char>::min()
  28.        << " valor maximo booleano: "
  29.        << numeric_limits<char>::max()
  30.        << " numero bytes: "
  31.        << sizeof(char)
  32.        << endl;
  33.  
  34.   cout  << "valor minimo entero: "
  35.     << numeric_limits<int>::min()
  36.     << " valor maximo entero: "
  37.     << numeric_limits<int>::max()
  38.     << " numero bytes: "
  39.     << sizeof(int)
  40.     << endl;
  41.  
  42.   cout << "valor minimo flotante: "
  43.        << numeric_limits<float>::min()
  44.        << " valor maximo booleano: "
  45.        << numeric_limits<float>::max()
  46.        << " numero bytes: "
  47.        << sizeof(float)
  48.        << endl;
  49.  
  50.  
  51.   return 0;
  52. }
Advertisement
Add Comment
Please, Sign In to add comment