What are loops? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

What are loops?

??

27th Dec 2016, 1:17 PM
mahesh naandade
mahesh naandade - avatar
8 Answers
+ 6
Code repeatition?
27th Dec 2016, 1:18 PM
Valen.H. ~
Valen.H. ~ - avatar
+ 6
Something that gets repeated again and again...(cycle)
27th Dec 2016, 1:19 PM
Valen.H. ~
Valen.H. ~ - avatar
+ 6
int a = 0; while (a < 10){ a++; } //This will stop when a = 10
27th Dec 2016, 1:21 PM
Valen.H. ~
Valen.H. ~ - avatar
+ 3
what?
27th Dec 2016, 1:18 PM
mahesh naandade
mahesh naandade - avatar
+ 3
ok. any example?
27th Dec 2016, 1:20 PM
mahesh naandade
mahesh naandade - avatar
+ 3
ook
27th Dec 2016, 1:22 PM
mahesh naandade
mahesh naandade - avatar
+ 3
thank u valentin and ivan.i think i got some idea about it.
27th Dec 2016, 1:27 PM
mahesh naandade
mahesh naandade - avatar
+ 2
Well, a loop is a process repeating itself from the very beginning once it finished all the operations inside it. In real life: - wake up; - go to job; - work 8 hours; - come back home; - spend free time; - sleep. Loop starts with "wake up" and finishes with "sleep". In coding you may take an example of progression or factorial. Because factorial is a loop. 4! = 4*3*2*1, each value decrements by 1 until it becomes 1 itself. You know I mean? :)
27th Dec 2016, 1:25 PM
Ivan Karev (RagingFireGaming)
Ivan Karev (RagingFireGaming) - avatar