Menentukan nilai maksimal dari JCreator,
langsung sedot ja scrip'a gan..
selamat mencoba (^_^)
class NilaiMax{
public static void main(String[] args){
int[] A={10,30,4,8,34,45,43,87,57,12};
int i=0, MAX=A[0], MIN=A[0];
while(i<=9){
if(A[i]<=MIN)MIN=A[i];
i++;
if(A[i]>=MAX)MAX=A[i];
i++;
}
for(i=0;i<=9;i++)
System.out.print(" "+A[i]);
System.out.println();
System.out.print("MIN = "+MIN);
System.out.println();
System.out.print("MAX = "+MAX);
System.out.println();
}
}
- Judul : Menentukan NilaiMax Menggunakan JCreator
- Penulis : Rizaldy Eka Jaya
- Kategori : Materi
-
Rating : 100% based on 10 ratings. 5 user reviews.
Item Reviewed: Menentukan NilaiMax Menggunakan JCreator
9 out of 10 based on 10 ratings. 9 user reviews.