//Arrays Question 1 solution
#include <stdio.h>

void main()
{
	int numbers[8] = { 4,56,23,1,34,21,98,456 };//Part a - set up array
	int i;
	int total;

	//Part b - print array on the screen
	for (i = 0; i <= 7; i++)
	{
		printf("%d\n", numbers[i]);
	}
	printf("----------------------------\n");

	//Part c - print array on the screen in reverse order
	for (i = 7; i >= 0; i--)
	{
		printf("%d\n", numbers[i]);
	}
	printf("----------------------------\n");

	//Part d - allow the user to enter the values for the 8 elements:
	for (i = 0; i <= 7; i++)
	{
		printf("Enter next value: ");
		scanf("%d", &numbers[i]);
	}
	for (i = 0; i <= 7; i++)//(print the array so that we can see the numbers that we input)
	{
		printf("%d\n", numbers[i]);
	}
	printf("----------------------------\n");

	//Part e - multiply each value by 2 
	for (i = 0; i <= 7; i++)
	{
		total = numbers[i] * 2;
		printf("Element %d multiplied by 2 is: %d\n", i, total);
	}



}