+ 3
What are some few helpful tips on loops?
Are there general helpful tips that someone can share on loops(Any language is okay since their functioning is similar). I already know how they work in general but still struggle with them in some areas. I noted this because I fail almost every loop related question on challenges. I'd appreciate a sort of simplified guide on how to look at loops in different perspectives.
4 ответов
+ 4
the most common loop questions on sololearn are loops nested in other loops!I don think any course explains those.
int a=0;
for(int I=0;I<7;I++)
{
for(int v=0;v<5;v++)
{
a++;} }
To calculate how the work just do the number of times the outermost loop runs multiplied with the number of times the innermost loop runs I.e 7×5=35!
so you can guess a=35;
hope I helped
+ 1
:0
0
I did a lot of research and came up with something
https://code.sololearn.com/WJmHP9Lq9A5V/#html