how to writt array in c++
#include <iostream>
int main() {
// Declare an array of integers with size 5
int myArray[5];
// Access and modify elements of the array
myArray[0] = 10;
myArray[1] = 20;
myArray[2] = 30;
myArray[3] = 40;
myArray[4] = 50;
// Print the elements of the array
for (int i = 0; i < 5; i++) {
std::cout << "Element " << i << ": " << myArray[i] << std::endl;
}
return 0;
}