Skip to content

Instantly share code, notes, and snippets.

@sugiartocokrowibowo
Created September 29, 2019 03:45
Show Gist options
  • Save sugiartocokrowibowo/244884ccbe11e9a79a57966bb85b56a4 to your computer and use it in GitHub Desktop.
Save sugiartocokrowibowo/244884ccbe11e9a79a57966bb85b56a4 to your computer and use it in GitHub Desktop.
import java.util.scanner;
public class LatihanArray003{
public static void main(String[]amirul){
Scanner sc = new Scanner(System.in);
System.out.print("Input Panjang Array Integer: ");
int p = sc.nextInt();
int[] myArray;
myArray = new int[p];
for(int k=0;k<myArray.length;k++){
System.out.print("Input elemen myArray["+k+"]: ");
myArray[k] = sc.nextInt();
}
for(int k=0;k<myArray.length;k++){
System.out.println(myArray[k]);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment