Posts

Showing posts with the label nested loops

Loops : Some Info

     Hi, conditional operators, variables are the base of any program apart from it's functionality to communicate with system. 2nd important thing is control that is the flow of statements. Now simple programs like hello world can do fine with those but when we start to make such programs which need to take big decisions and directions, we encounter a problem that is re-using a piece of code or in simple words repetition of a piece of code.      Loops are very helpful and can be considered basic of programming. Let's have a look at loop system how to use them and get some common error information. A loop is made up of 2 basic parts, one is it's body which contains the code that is going to be looped and 2nd is the condition around which we want to loop the code. both of course are very important. Without either one of them, loop is useless. Simplest loop is while loop. it describes basic functionality of loops: #include <iostream> using names...