Skip to content
Snippets Groups Projects
Commit c92c966c authored by Rudi Buss's avatar Rudi Buss
Browse files

Update Solution Exercise 1 - Farm.cpp

parent 9645b758
Branches main
No related tags found
No related merge requests found
......@@ -2,21 +2,16 @@
using namespace std;
int main()
{
int AnimalNumber[50];
int main() {
int AnimalNumber[50];
for(int i=0; i<50; i++)
{
AnimalNumber[i]=i+1; // For example, the number 1 is stored in the first array index AnimalNumber[0].
}
for (int i = 0; i < 50; i++) {
AnimalNumber[i] = i + 1; // For example, the number 1 is stored in the first array index AnimalNumber[0].
}
for(int i=0; i<50; i++)
{
cout << "AnimalNumber[" << i << "]: " << AnimalNumber[i] << endl; // For example, the number 1 is stored in the first array index AnimalNumber[0].
}
return 0;
for (int i = 0; i < 50; i++) {
cout << "AnimalNumber[" << i << "]: " << AnimalNumber[i] << endl; // For example, the number 1 is stored in the first array index AnimalNumber[0].
}
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment