Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int max (int x[]);
- int main()
- {
- int arr[4] = {3,3,2,2};
- int x= max(arr);
- cout<<x<<endl;
- system("pause");
- return 0;
- }
- int max (int temp[])
- {
- int max=temp[1];
- for(int i=1;i<temp[0];i++)
- {
- if(max<temp[i+1])
- max=temp[i+1];
- }
- return max;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement