int array[9]; //decalre the array
array[index] = user's input; //index goes from 0-8
for(int i = 0; i < 9; i++)
printf("%d\n", array[i])
float maxNum 0;
intindex_of_max_num = 0;
for ( i = 0; i < 9; i++)
{ scanf("%f", &total);
array[ i ] = total;
if(total > maxNum) {
maxNum = total;
index_of_max_num = i;
}
}
float minNum;
for ( i = 0; i < 9; i++)
{ scanf("%f", &total);
array[ i ] = total;
if(1 = 0) { //if this is the first number
minNum = total; //insure that minNum is actually set
}
if(total < minNum) {
minNum = total;
}
}
float minNum;
float maxNum = 0;
for ( i = 0; i < 9; i++)
{ scanf("%f", &total);
array[ i ] = total;
if(1 = 0) { //if this is the first number
minNum = total; //insure that minNum is actually set
}
if(total < minNum) {
minNum = total;
}
if(total > maxNum) {
maxNum = total;
}
}
float total = 0;
for(i = 0; i < 9; i++) {
total += array[i];
}
float average = total/9;
If you are experiencing a similar issue, please ask a related question
Title | # Comments | Views | Activity |
---|---|---|---|
array6 challenfge | 6 | 106 | |
Super Scope, DHCP | 5 | 78 | |
t-sql sp_addlinkedserver possible risks | 3 | 72 | |
Problem to Alipay | 10 | 24 |
Join the community of 500,000 technology professionals and ask your questions.