Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* 5.11 Find the Smallest Value
- Deitel & Deitel C++ How to Program, 10th ed (Indian sub continent edition)
- Visual Studio Community 2019 */
- #include <limits>
- #include <iostream>
- using namespace std;
- int main(void) {
- int foundMin = INT_MAX;
- cout << "Enter the number of integers you will be entering: ";
- int numberOfInts{ 0 }, count{ 0 }, num{ 0 };
- cin >> numberOfInts;
- while (count < numberOfInts) {
- cout << "#"<< count + 1 << " Enter an integer and hit <Enter> ";
- cin >> num;
- if (num < foundMin) foundMin = num;
- count++;
- }
- cout << "The smallest integer is " << foundMin;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment