#include <iostream>
using namespace std;

int main() {
    int i,n,arr[10];
    cout<<"total elements \n";
    cin>>n;
    
    cout<<"enter numbers\n";
    for(i=0;i<n;i++) {
        cin>>arr[i];
    }
    
    for(i=0;i<n;i++){
        if(arr[0]<arr[i]){
            arr[0]=arr[i];
        }
    }
    cout<<"largest elememt is:"<<arr[0];
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: