codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
#include <iostream> #include <climits> #include <cfloat> using namespace std; int main() { cout << "Size of char = " << sizeof(char) << endl; cout << "Size of int = " << sizeof(int) << endl; cout << "Size of short = " << sizeof(short) << endl; cout << "Size of unsigned int = " << sizeof(unsigned int) << endl; cout << "Size of long = " << sizeof(long) << endl; cout << "Size of bool = " << sizeof(bool) << endl; cout << "Size of float = " << sizeof(float) << endl; cout << "Size of double = " << sizeof(double) << endl; cout << "Size of long double = " << sizeof(long double) << endl; cout << "Size of unsigned short = " << sizeof(unsigned short) << endl; cout << "Size of unsigned long = " << sizeof(unsigned long) << endl; cout << endl; cout << "Number of bits in a byte " << CHAR_BIT << endl; cout << "Maximum char value " << CHAR_MAX << endl; cout << "Minimum char value " << CHAR_MIN << endl; cout << "Maximum short value " << SHRT_MAX << endl; cout << "Minimum short value " << SHRT_MIN << endl; cout << "Maximum int value " << INT_MAX << endl; cout << "Minimum int value " << INT_MIN << endl; cout << "Maximum long value " << LONG_MAX << endl; cout << "Minimum long value " << LONG_MIN << endl; cout << "Maximum unsigned char value " << UCHAR_MAX << endl; cout << "Minimum unsigned short value " << USHRT_MAX << endl; cout << "Maximum unsigned int value " << UINT_MAX << endl; cout << "Minimum unsigned long value " << ULONG_MAX << endl; cout << endl; cout << "Approximate number of significant digits in a float value " << FLT_DIG << endl; cout << "Maxium postive float value " << FLT_MAX << endl; cout << "Minium postive float value " << FLT_MIN << endl; cout << "Approximate number of significant digits in a double value " << DBL_DIG << endl; cout << "Maxium postive double value " << DBL_MAX << endl; cout << "Minium postive double value " << DBL_MIN << endl; cout << "Approximate number of significant digits in a long double value " << LDBL_DIG << endl; cout << "Maxium postive double value " << LDBL_MAX << endl; cout << "Minium postive double value " << LDBL_MIN << endl; return 0; }
Private
[
?
]
Run code
Submit