Skip to content

Instantly share code, notes, and snippets.

@mattsegura
Created November 26, 2020 08:14
Show Gist options
  • Save mattsegura/6e4b8e5833c5f5650235de4eb11d4238 to your computer and use it in GitHub Desktop.
Save mattsegura/6e4b8e5833c5f5650235de4eb11d4238 to your computer and use it in GitHub Desktop.
takes user input to output userinput with arrays
#include <iostream>
#include <array>
using namespace std;
int main()
{
int numArray[5];
for (int i = 0; i < 5; i++)
{
cout << "Enter the 5 numbers: ";
cin >> numArray[i];
}
for (int i = 0; i < 5; i++)
cout << numArray[i] << " ";
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment