int a[5]
for(i=0:i<=5:i++){
cout<<a[i]
ignore the colon here why loop is used to print the values or accesing the elements
For loop doubts
If you want to print all the elements in an array then you use for loop, but if you want to print a single index in an array.
You can refer to this too
Here it’s printing 3rd index of the array which is 6, you can add particular index to i , to print that index.
no my question is iterator variable i is used for iterating array or printing
It’s used for both, iterating over elements as well as printing them too.