Advertisement
alkelane7

mins

Apr 20th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include<iostream.h>
  2. int small(int arr[],int n);
  3. int main ()
  4. {
  5. int arr[10], n, i, min;
  6. cout << "Enter the size of the array : ";
  7. cin >> n;
  8. cout << "Enter the elements of the array : ";
  9. for (i = 0; i < n; i++)
  10. cin >> arr[i];
  11. min=small( arr,n);
  12. cout<<min; return 0;}
  13. int small(int arr[],int n) { int mins; int i;
  14.  
  15.  
  16. mins= arr[0];
  17. for (i = 0; i < n; i++)
  18. {
  19. if (mins> arr[i])
  20. mins= arr[i];
  21. }
  22. return mins; }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement