BrokeMansPC

Program 3 - 4.12.2020

Dec 4th, 2020
464
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <math.h>
  3. #include <iomanip>
  4.  
  5. using namespace std;
  6. int main(){
  7.    
  8.     int n[20];
  9.     int nm;
  10.     cout << "Program 3 | Veljko Kovacevic IV3" << endl;
  11.  
  12.     for(int i = 0; i < 20; i++) {
  13.         cout << "n[" << i << "] : ";
  14.         cin >> n[i];
  15.     }
  16.  
  17.     nm = n[0];
  18.  
  19.     for (int i = 0; i < 20; i++)
  20.         if(n[i] < nm) nm = n[i];
  21.  
  22.     cout << "Najmanji broj u nizu je " << nm << endl;
  23.  
  24.     cout << "Niz: " << endl;
  25.     for (int i = 0; i < 20; i++)
  26.         cout << n[i] << " ";
  27. }
RAW Paste Data