forked from spartacruz/c
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharray1.c
More file actions
35 lines (29 loc) · 779 Bytes
/
array1.c
File metadata and controls
35 lines (29 loc) · 779 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <stdio.h>
/************************************
Algoritma terrendah
{ Deskripsi : Mencari nilai terrendah beserta indeks arraynya
IS : user siap memasukkan nilai
FS : tampil dilayar nilai terrendah berserta indeks arraynya
Dibuat oleh : Yuri Iskandia Barru
Tanggal : 11 - 12 - 2015
*************************************/
void main (void)
//KAMUS *****************************
{ int A[8], b, i, c;
//ALGORITMA *************************
i = 1;
printf ("Masukkan Nilai Pertama : "); scanf ("%d", &A[i]);
b = A[i]; c = 1;
while (i < 7)
{
i++;
printf ("Masukkan Nilai ke- %d : ", i); scanf ("%d", &A[i]);
if (b >= A[i])
{
b = A[i];
c = i;
}
}
printf ("\nNilai terendah adalah = %d dan berada pada indeks ke - %d\n", b, c);
system ("pause");
}