0

Subject : Arrays in Loops

Can you tell me how this software came about ? I am not understand this. #include <iostream> using namespace std; int main() { int myArr[6]; for(int x=0; x<5; ++x) { myArr[x] = 42; cout << x << ": " << myArr[x] << endl; } return 0; } How does myArr work?

22nd May 2020, 3:00 PM
Mehmet Ali Baykara
Mehmet Ali Baykara - avatar
3 Respuestas
+ 2
It will display 0:42 1:42 2:42 3:42 4:42 Please ask the question more clear. Mention your doubt more specifically
22nd May 2020, 3:23 PM
Faisal Rahman
Faisal Rahman - avatar
+ 2
How does myArr work?
22nd May 2020, 7:14 PM
Mehmet Ali Baykara
Mehmet Ali Baykara - avatar
23rd May 2020, 11:19 AM
Emmanuel Abraham