Skip to content

Instantly share code, notes, and snippets.

@imryan
Created October 10, 2013 21:50
Show Gist options
  • Select an option

  • Save imryan/6926190 to your computer and use it in GitHub Desktop.

Select an option

Save imryan/6926190 to your computer and use it in GitHub Desktop.
Filling an array and looping through it.
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
int homes[5];
for (int i = 0; i < 5; i++) {
cin >> homes[i];
}
for (int j = 0; j < 5; j++) {
cout << homes[j] << "\t";
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment