+ 2
I want to know about the loops and in which way they are useful for programs?
Help in understanding loops
4 Answers
+ 2
Does your program end after a few milliseconds? If not, there is a loop waiting for input and showing results.
+ 2
For example, they are useful when the program needs to perform a variable number of similar calculations.
+ 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
+ 1
I think it`s importance is the repeatedly
that help you saving time and efforts (: