Answers for "print array elements in c++"

C++
3

print array c++

void printArray(int a[],int n){
	for(int i=0;i<n;i++)
      cout<<a[i]<<" ";
  	cout<<endl;
}
Posted by: Guest on February-10-2021
1

prints out the elements in the array c++

for (auto i : a){ //C++11
	cout << i<< " ";
}
Posted by: Guest on March-27-2021

Browse Popular Code Answers by Language