This Java program creates an array of integers with size 7, prompts the user to input values into the array, and then prints out the values of the array. Here's a brief explanation of what the program does:
import java.util.Scanner; class Store_Elements { public static void main(String[] args) { Scanner input =new Scanner(System.in); int [] a =new int[7]; for(int i=0;i<7;i++) { System.out.printf("Element of a[%d] :",i); a[i]=input.nextInt(); } System.out.println("\nDisplay Array Elements...\n"); for(int e:a) { System.out.println(e); } } }
Element of a[0] :5 Element of a[1] :11 Element of a[2] :22 Element of a[3] :33 Element of a[4] :44 Element of a[5] :55 Element of a[6] :66 Display Array Elements... 5 11 22 33 44 55 66
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions