Advertisement
Pappu19

Maximum number of Array

Dec 8th, 2021
943
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     int n,maxm= 0;
  7.  
  8.     cin>>n;
  9.  
  10.     int arr[n];
  11.  
  12.     for(int i=0; i<n; i++)
  13.     {
  14.         cin>>arr[i];
  15.     }
  16.  
  17.     for(int i=0; i<n; i++)
  18.     {
  19.         if(maxm < arr[i])
  20.             maxm = arr[i];
  21.     }
  22.     cout<<maxm;
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement