Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int size;
- cout << "Enter the number of numbers you want to enter: ";
- cin >> size;
- int num[size];
- cout << "Enter the numbers: ";
- for (int i = 0; i < size; i++) {
- cin >> num[i];
- }
- int minNum = num[0]; // assume first is minimum
- for (int i = 1; i < size; i++) {
- if (num[i] < minNum) {
- minNum = num[i];
- }
- }
- cout << "The minimum number is: " << minNum << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement