Arrays
unknown
java
4 years ago
602 B
13
Indexable
package com.sai.datastructures;
// library import
import java.util.Scanner;
// Class declaration
public class Prakash {
// main method or function, starting point of program execution
public static void main(String[] args) {
// arrays
// 0 -> size - 1
int[] a = new int[5];
double[] d = new double[5];
Scanner sc = new Scanner(System.in);
for (int i = 0; i < 5; i++) {
a[i]= sc.nextInt();
}
for (int i = 0; i < 5; i++) {
System.out.println("Value at index " + i + " - " + a[i]);
}
}
}
Editor is loading...