N x y z
5
1 2 3 4 5
how do i have to take input input n in first and then n sapace separated intgers or all in same line including n
N x y z
5
1 2 3 4 5
how do i have to take input input n in first and then n sapace separated intgers or all in same line including n
int n=scn.nextInt();
then make a array of size n
int arr[]=new int[n];
then take n integers
for(int i=0;i<n;i++)
arr[i]=scn.nextInt();
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.