#include <iostream.h>
#include <conio.h>
void main() {
int A[10] = {1,2,3,4,5,6,7,8,9,10};
int n = 10;
cout << "Nilai array asal : ";
for (int i=0; i<n; i++)
cout << "Nilai indeks ke-[" << i << "] adalah " << A << endl;
getch();
}
Import to java :
public class Main {
public static void main(String[] args) {
int[] A={1,2,3,4,5,6,7,8,9,10};
int n = 10;
System.out.println("Nilai array asal ");
for (int i = 0; i < n; i++) {
System.out.println("Nilai Indeks ke ["+i+"] adalah : "+A+"\n");
}
}
}
Tidak ada komentar:
Posting Komentar