Answer to Question #181178 in C++ for luna

Question #181178

Write an application that stores 12 integers in an array. Display the ingeter from first to last, and then display the integers from last to first.


1
Expert's answer
2021-04-14T03:29:49-0400
#include <iostream>
 
using namespace std;
 
int main()
{
	int A[12] = { 1, 2, 3, 5, 6, 9, 5, 10, 5, 8, 12, 11 };
	cout << "Array in right order: ";
	for (int i = 0; i < 12; i++)
	{
		cout << A[i] << " ";
	}
	cout << endl;
	cout << "Array in reverse order: ";
	for (int i = 11; i >= 0; i--)
	{
		cout << A[i] << " ";
	}
	cout << endl;
	return 0;
}

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