I am getting this error every time i try to run the program.
Question : ask the user to enter 10 numbers, then find their average, then show only numbers Smaller than Average.
I also tried changing
Thank you in advance for your help
Question : ask the user to enter 10 numbers, then find their average, then show only numbers Smaller than Average.
#include<iostream> using namespace std; int main() { const int Numbers = 10; //Declar size of the array int A[Numbers]; int i; double Average; cout<<"Enter 10 numbers"<<endl; for (i=0;i<Numbers; i++) { cin>>A[Numbers]; Sum = +A[Numbers]; } for (i=0;i<10;i++) Average = Sum/Numbers; if (A[Numbers] < Average)cout<<A[Numbers]<<"\t\t"; return 0; }
I also tried changing
A[Numbers] with A[i]for all codes , which worked but showed random number -8354353
Thank you in advance for your help