What is loop | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson

What is loop

5th Apr 2017, 4:41 PM
Aditya Singh
Aditya Singh - avatar
3 Answers
+ 5
Suppose you have some statements in a code which should be executed multiple times. Instead of writing those statements as many times as needed, you can use a loop and set a condition so that those statements will be executed as many times as needed and stops when the condition becomes false.
6th Apr 2017, 12:45 AM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
"A loop statement allows us to execute a statement or group of statements multiple times." https://www.tutorialspoint.com/cplusplus/cpp_loop_types.htm
5th Apr 2017, 4:47 PM
Eranga - avatar
if u want to execute a statement multiple times then its better to use loop than writing the statement again
18th Apr 2017, 10:32 AM
Dude Lazy
Dude Lazy - avatar