I apologize if I am not following rules or if this topic is posted elsewhere, but I have written some code to correspond to the topic I am having issues with and the problem I am running into is that my program continues to prompt me to enter a number and what I am attempting to design is a program which accepts at most 10 integers and then displays them in descending order.
Code:#include <iostream> #include <algorithm> using namespace std; int main(){ int numb [10]; int i, j; for(i=0;1<=9;i++) { cout<<"Please enter numer: "; cin>> numb [i]; } for(i=0;i<=8;i++) { for(j=i+1;j<=8;j++) { int temp; if(numb[i] < numb[j]) { temp = numb[i]; numb[i] = numb[j]; numb[j] = temp; } } } for(i=0;i<=9;i++) { cout<< endl << numb [i]<<endl; system("pause"); return 0; } }