C++ Programming Challenge - Array Manipulation Challenge

Array Challenge
When completed, the following program should first fill in (by asking the user for input) and then list all the elements in an array:
#include <_____>
      
      using namespace std;
      ___ main()
{
  int array[8]___
  for(int x=_; x<_; ___)
  cin>>______;
  for(____; x<____; ___)
  cout<<_____;
  return __;
____


Solution:

Array Challenge Solution
The following program will first fill in (by asking the user for input) and then list all the elements in an array:
#include <iostream>
      using namespace std;
      int main()
{
  int array[8];
  for(int x=0; x<8; x++)
  cin>>array[x];
  for(int x=0; x<8; x++)
  cout<<array[x];
  return 0;
}

No comments:

Post a Comment