+ 1

Using for loop statements later (C++)

Is it possible use for loop statements outside the loop? Check link. I hope it will clarify my question. https://code.sololearn.com/cqdp56680DkH/?ref=app

22nd Feb 2019, 5:09 PM
Jari
Jari - avatar
4 Respuestas
+ 4
what do you want to do with those values? the only way i see you can use them is like Maneren said, to store them in a variable, like an array. here’s an example. i hope this answers your question. if not, let me know. https://code.sololearn.com/ciUH1Pm48uB7/?ref=app
22nd Feb 2019, 6:42 PM
Thomas
Thomas - avatar
+ 4
What about saving to variable
22nd Feb 2019, 6:08 PM
Maneren
Maneren - avatar
+ 2
Thank you Tomas! I have tried to store values in array but haven't succeed :D For novice even basic things can be difficult. I don't have any specific reason to do that. Many times I have played with for loops I have tried to find out how to do that. I just haven't found solution anywhere.
22nd Feb 2019, 7:10 PM
Jari
Jari - avatar
+ 2
Yes, when I first started coding arrays took a little getting used to. Just keep trying and you’ll get them. You can always ask if you have any specific questions. Or, you can post code that you want an opinion on how to get it to work. The code in my answer above shows how you can store the values in an array. Hopefully it helped.
22nd Feb 2019, 7:21 PM
Thomas
Thomas - avatar