C++ Program to Scan and Print Array

C++ Program to Scan and Print Array

Write C++ Program to Scan and Print Array

// CPP Program to Scan and Print Array

#include <iostream>

using namespace std;

int main()
{
	int A[5];
	int i;

	for(i = 0; i < 5; i++)
	{
		cout << "Enter Element - " << i + 1 << " :--> ";
		cin >> A[i];
	}

	cout << "\nYour Array : --> ";
	for(i = 0; i < 5; i++)
	{
		cout << A[i] << " ";
	}
	return 0;
}

Output:

Enter Element - 1 :--> 22
Enter Element - 2 :--> 33
Enter Element - 3 :--> 55
Enter Element - 4 :--> 11
Enter Element - 5 :--> 44

Your Array : --> 22  33  55  11  44