Answers for "Traversing a C++ Array"

C++
0

Traversing a C++ Array

#include <iostream>

using namespace std;

int main()
{
	int array[5]={1,2,3,4,5};
	// Way 1
	for(int i=0;i<5;i++)
		cout<<array[i]<<" ";
	
cout<<endl;
	return 0;
}
Posted by: Guest on May-05-2022

Code answers related to "Traversing a C++ Array"

Browse Popular Code Answers by Language