Create an array of size ten; assign one to all its positions one by one through loop, and show array elements one by one on screen with space.
#include <iostream>
using namespace std;
int main()
{
int arr[10];
cout << "Please, enter 10 values for array: ";
for (int i = 0; i < 10; i++)
{
cin >> arr[i];
}
cout << "Your array: ";
for (int i = 0; i < 10; i++)
{
cout<< arr[i]<<" ";
}
}
Comments
Leave a comment