0
How to put arrays elements by user?
If i create an array with 5 elements and i want instant of define those variables in beginning i want user to define them. How can i write that code?
1 Answer
+ 4
Use a for loop:
for(int i=0;i<size;i++)
cin>>arr[i];
But, the user also needs to input the size before entering the array...