+ 2

I want to know about the loops and in which way they are useful for programs?

Help in understanding loops

21st Apr 2017, 4:11 AM
Rajat kumar
Rajat kumar - avatar
4 Answers
+ 2
Does your program end after a few milliseconds? If not, there is a loop waiting for input and showing results.
21st Apr 2017, 4:30 AM
1of3
1of3 - avatar
+ 2
For example, they are useful when the program needs to perform a variable number of similar calculations.
21st Apr 2017, 4:34 AM
Igor B
Igor B - avatar
+ 1
normally all programs executed from top to bottom in a way one instruction exicuted once only ,but in between if you want some instruction to be executed multiple time you should use loops there eg: System.out.print("start"); for (int i=0;i<5:i++) System.out.print(i); System.out.print("end"); here the 3 line executed 5 times
21st Apr 2017, 5:04 AM
ASHMIL HUSSAIN
ASHMIL HUSSAIN - avatar
+ 1
I think it`s importance is the repeatedly that help you saving time and efforts (:
21st Apr 2017, 12:36 PM
ali abou-bakr
ali abou-bakr - avatar