| 1 | #include<iostream.h> |
| 2 | using namespace std; |
| 3 | void max(int arr[5]) |
| 4 | { |
| 5 | int max[5]; |
| 6 | max[0]=0; |
| 7 | int k=0; |
| 8 | for(int i=0;i<5;i++) |
| 9 | { |
| 10 | if(arr[i]>max[k]) |
| 11 | max[k]=arr[i]; |
| 12 | } |
| 13 | cout<<"maximum number is:"<<max[k]; |
| 14 | } |
| 15 | int main(){ |
| 16 | int arr[5],i; |
| 17 | cout<<"enter members of an array:"<<endl; |
no outgoing calls