0

I don't know why it always gets wrong, can someone help me?

https://code.sololearn.com/c0l8Zb2jo9m4/?ref=app

16th Apr 2021, 2:44 AM
Nur Anisa Hidayatul Masruroh
Nur Anisa Hidayatul Masruroh - avatar
3 Réponses
+ 4
You should always put your codes in main int main() { int myArr[5]; for(int x=0; x<5; x++) { myArr[x] = 42; cout << x << ":" << myArr[x] << endl; } return 0; }
16th Apr 2021, 2:49 AM
Hoh Shen Yien
Hoh Shen Yien - avatar
0
NurAnisa Hidayatul Masruroh Or you can create a method, write code in that method and call that method in main method. https://code.sololearn.com/ch6144Ls0Yty/?ref=app
16th Apr 2021, 2:58 AM
A͢J
A͢J - avatar
0
Thank you all for the answers
17th Apr 2021, 2:53 AM
Nur Anisa Hidayatul Masruroh
Nur Anisa Hidayatul Masruroh - avatar