Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save justgo129/ee44eb680b36363cca2006607fe8e032 to your computer and use it in GitHub Desktop.
Save justgo129/ee44eb680b36363cca2006607fe8e032 to your computer and use it in GitHub Desktop.
// C++ program asks user to input 5 values (to fill array)
// and then the computer returns those five values.
#include <iostream>
using namespace std;
int main() {
// get input from users
int arr[5];
cout<<"Please state 5 integers\n";
cin.get();
for (int i=0; i<5; i++ ) {
cin>> arr[i];
}
// we now return those identical values
for (int i =0; i<5; i++) {
cout << " " << arr[i];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment