range - cin >> temp; if (temp > max) max = temp;...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
# include <iostream> # include <limits> using namespace std; int main (void) { int number, temp, min = INT_MAX, max = INT_MIN, range; cout << "Enter the number of elements: "; cin >> number; for (int i = 1; i <= number; i++) { cout << "Enter a number: ";
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: cin >> temp; if (temp > max) max = temp; if (temp < min) min = temp; } cout << "The smallest number is: " << min << "\n"; cout << "The largest number is: " << max << "\n"; cout << "The range is: " << max - min; return 0; }...
View Full Document

This note was uploaded on 04/24/2010 for the course COS 120 taught by Professor Bonev during the Fall '08 term at American University in Bulgaria.

Ask a homework question - tutors are online