hey again i have small problem i need help i want to print the "year with greatest and smallest increase and decrease" the years are from 2000 to 2009. i know how to print the greatest and smallest number in the array but i don't know how to print the year. here is half of the code of the program the one that's important for you.
void maxIncDecYears(int annualIncome[],int arraySize){
year = 2000;
int max = annualIncome[0],min = annualIncome[0];
for(int z = 1; z < arraySize; z++){
if(max < annualIncome[z]){
max = annualIncome[z];
year++;
}
}
cout << "Year with maximum income increased: " << year << endl;
year = 2000;
for(int x = 1; x < arraySize; x++){
if(min > annualIncome[x]){
min = annualIncome[x];
year++;
}
}
cout << "Year with maximum income decreased: " << year << endl;
}