Answer to Question #348545 in C++ for Hasnat

Question #348545

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.

1
Expert's answer
2022-06-06T08:57:12-0400
#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]<<" ";
	}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS