One line input of array.easiest way

for(T &i:arr)cin>>i;
HOW IT IS WORKING

@SOHAN For arrays a trick is to use range based for loop. T is a generic data type. By using & we take input baby reference and can change the value of array. i is a variable which is pointing to start of array and updating with each iteration.

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.