how to print items in c++
#include <iostream>
int main() {
// Declare an array of integers
int items[] = {1, 2, 3, 4, 5};
// Calculate the number of elements in the array
int itemCount = sizeof(items) / sizeof(items[0]);
// Iterate through the array and print each item
for (int i = 0; i < itemCount; ++i) {
// Print the current item followed by a space
std::cout << items[i] << " ";
}
// Print a newline character to move to the next line
std::cout << std::endl;
// Return 0 to indicate successful execution
return 0;
}