Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream.h>
- int small(int arr[],int n);
- int main ()
- {
- int arr[10], n, i, min;
- cout << "Enter the size of the array : ";
- cin >> n;
- cout << "Enter the elements of the array : ";
- for (i = 0; i < n; i++)
- cin >> arr[i];
- min=small( arr,n);
- cout<<min; return 0;}
- int small(int arr[],int n) { int mins; int i;
- mins= arr[0];
- for (i = 0; i < n; i++)
- {
- if (mins> arr[i])
- mins= arr[i];
- }
- return mins; }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement