Quick actions

cmd+k|ctrl+k

Navigation

Languages

max number in an array

Snippet info

Language

Cpp

Visibility

public

Author

mothilaljadav0304

Created

2026-06-27T20:32:50.810274Z

Updated

2026-06-27T20:32:50.810274Z

#include <iostream>
using namespace std;

int main() {
    int a[6] = {2,4,6,8,3,9};
    int max=a[0];
    
    for(auto x:a){
        if(x>max){
            max = x;
        }
    }
    cout<<"maximum number is "<<max;
    return 0;
}
INFO