Answers for "Accessing C++ Array Elements"

C++
0

Accessing C++ Array Elements

#include <iostream>
using namespace std;

int main()
{
	int arr[4];
	arr[0] = 2;
	arr[2] = -5;

	arr[3/2] = 1;
	arr[3] = arr[0];

	cout << arr[0] << " " << arr[1] << " " << arr[2] << " "
		<< arr[3];

	return 0;
}
Posted by: Guest on May-05-2022

Code answers related to "Accessing C++ Array Elements"

Browse Popular Code Answers by Language