c input an array code example
Example 1: take array as input in c
int size=5;
int array[size];
for(i=0;i<size;i++){
scanf("%d",&array[i]);
}
Example 2: how to get array input in java
public class TakingInput {
public static void main(String[] args) {
Scanner s=new Scanner(System.in);
System.out.println("enter number of elements");
int n=s.nextInt();
int arr[]=new int[n];
System.out.println("enter elements");
for(int i=0;i<n;i++){
arr[i]=s.nextInt();
}
for(int i: arr){
System.out.println(i);
}
}
}