We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5e5d6cf commit ae93438Copy full SHA for ae93438
prog.8.9.c
@@ -0,0 +1,32 @@
1
+// Function to find the minimum value in an array
2
+
3
+#include <stdio.h>
4
5
+int minimum (int values[10])
6
+{
7
+ int minValue, i;
8
9
+ minValue = values[0];
10
11
+ for ( i = 1; i < 10; ++i )
12
+ if ( values[i] < minValue )
13
+ minValue = values[i];
14
15
+ return minValue;
16
+}
17
18
+int main (void)
19
20
+ int scores[10], i, minScore;
21
+ int minimum (int values[10]);
22
23
+ printf ("Enter 10 scores\n");
24
25
+ for ( i = 0; i < 10; ++i )
26
+ scanf ("%i", &scores[i]);
27
28
+ minScore = minimum (scores);
29
+ printf ("\nMinimum score is %i\n", minScore);
30
31
+ return 0;
32
0 commit comments