Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

Design a program that will determine the lowest and the highest of 10 numbers entered by the users in C++

+1 vote
asked Feb 5, 2018 by Justin Apilado (440 points)

1 Answer

0 votes
answered Feb 7, 2018 by Laxaman Pal (440 points)

#include <iostream>

using namespace std;

int main()
{

int i, arr[10];

cout<<"Enter 10 numbers :  "<<endl;

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

cin>>arr[i];

}
int max, min;
  max = min = arr[0];

for(i=0;i<10;i++){
    if(arr[i]>max)  max = arr[i];
    if(arr[i]<min)  min = arr[i];
    
}

cout<<"\nHighest value : "<<max<<endl;
cout<<"Lowest Value : "<<min<<endl;
    return 0;
}

Cheers!!!yes

commented Feb 7, 2018 by Justin Apilado (440 points)
THAAAAAAAANKKSSSS!!! YOU SAVED MY LIFE!!
commented Feb 12, 2018 by anonymous
yeah, u saved his life
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...