Buat program untuk menampilkan data nilai siswa!.
dimana nilai[5]={70,80,67,90,100}
jawab :
import java.util.Scanner;
public class NilaiArray
{
public static void main(String [] args)
{
Scanner scan=new Scanner(System.in);
int [] nilai = {70,80,67,90,100};
for (int i=0;i<5;i++)
{
System.out.println("Nilai ke-"+i+" = "+nilai[i]);
}
}
}
dimana nilai[5]={70,80,67,90,100}
jawab :
import java.util.Scanner;
public class NilaiArray
{
public static void main(String [] args)
{
Scanner scan=new Scanner(System.in);
int [] nilai = {70,80,67,90,100};
for (int i=0;i<5;i++)
{
System.out.println("Nilai ke-"+i+" = "+nilai[i]);
}
}
}
Tidak ada komentar:
Posting Komentar