cs161AWinter2024/badarray.cpp

18 lines
347 B
C++

#include <iostream>
using namespace std;
int main(){
int myArray[10];
for(int i = 0; i < 10; i++){
myArray[i] = i*i + 1;
}
cout << myArray[0] << endl;
cout << myArray[1] << endl;
//...
myArray[200] = 12345;
cout << myArray[200] << endl;
cout << "What is the value of the array variable: " << myArray << endl;
return 0;
}