max number in an array

Run Settings
LanguageC++
Language Version
Run Command
#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; }
Editor Settings
Theme
Key bindings
Full width
Lines