New course! Every coder should learn Generative AI!
Try a free lesson+ 3
What are loops?
??
8 Answers
+ 6
Code repeatition?
+ 6
Something that gets repeated again and again...(cycle)
+ 6
int a = 0;
while (a < 10){
a++;
}
//This will stop when a = 10
+ 3
what?
+ 3
ok. any example?
+ 3
ook
+ 3
thank u valentin and ivan.i think i got some idea about it.
+ 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? :)