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;
Title | # Comments | Views | Activity |
---|---|---|---|
maxBlock challenge | 30 | 101 | |
NotAlone Challenge | 20 | 72 | |
upcasting down casting object remains same but refernece changes | 8 | 56 | |
Copy Files - Python | 7 | 57 |
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
13 Experts available now in Live!