PROGRAM CODE FOR MAXIMUM AND MINIMUM RANGE

PROGRAM CODE FOR MAXIMUM AND MINIMUM RANGE - double...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
#include <limits> #include <iostream> using std::cout; using std::endl; using std::numeric_limits; int main() { cout << "The range for type short is from " << numeric_limits< short >::min() << " to " << numeric_limits< short >::max(); cout << "The range for type int is from " << numeric_limits< int >::min() << " to " << numeric_limits< int >::max(); cout << "The range for type long is from " << numeric_limits< long >::min() << " to " << numeric_limits< long >::max(); cout << "The range for type float is from " << numeric_limits< float >::min() << " to " << numeric_limits< float >::max(); cout << "The range for type double is from " << numeric_limits<
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: double &gt;::min() &lt;&lt; &quot; to &quot; &lt;&lt; numeric_limits&lt; double &gt;::max(); cout &lt;&lt; &quot;The range for type long double is from &quot; &lt;&lt; numeric_limits&lt; long double &gt;::min() &lt;&lt; &quot; to &quot; &lt;&lt; numeric_limits&lt; long double &gt;::max(); cout &lt;&lt; endl; return ; } ANSWER: The range for type short is from -32768 to 32767The range for type int is from -2147483648 to 2147483647The range for type long is from -2147483648 to 214748364 7The range for type float is from 1.17549e-038 to 3.40282e+038The range for type double is from 2.22507e-308 to 1.79769e+308The range for type long double is fr om 0 to 1.#INF...
View Full Document

This note was uploaded on 07/27/2011 for the course COL 201 taught by Professor Magtibay during the Winter '10 term at De La Salle Lipa.

Page1 / 2

PROGRAM CODE FOR MAXIMUM AND MINIMUM RANGE - double...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online