write a program to enter ten numbers and display the highest using array.

Recommended Answers

All 2 Replies

I think you are confused. First you write the program and then you post it with any problems you are having.

using namespace std;

int main(){
    float arr[10];
cout<<"please enter 10 numbers"<<endl;

for(int i=0; i<10; i++){

for(int i=0; i<9; i++){
    int small = i;
    for(int j=i+1; j<10; j++){
       small = j;

cout<<"\nThe greatest number is "<<arr[9]<<endl;
return 0;}

make sure you understand the code...that's a good programmer's habit

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.