Answer to Question #42791 in C for chernet merkneh

Question #42791
write an algorithm to find the smallest number from ten numbers
1
Expert's answer
2014-05-28T10:01:10-0400
#include <stdio.h>
int main() {
int array[10];
int min = 0;
printf("Please input 10 integers\n");
scanf("%d", &array[0]);
min = array[0] ;
for ( int i = 1; i < 10; i++ ) {
scanf("%d", &array[i]);
if ( array[i] < min ) {
min = array[i];
}
}
printf("Here is our minimum %d\n", min);
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS