c++ define array with values
#include <iostream>
int main() {
// Declare an array of integers with a size of 5
int myArray[5];
// Initialize the array elements with specific values
myArray[0] = 10;
myArray[1] = 20;
myArray[2] = 30;
myArray[3] = 40;
myArray[4] = 50;
// Display the values of the array elements
for (int i = 0; i < 5; ++i) {
std::cout << "myArray[" << i << "] = " << myArray[i] << std::endl;
}
return 0;
}