Sequence Of A Sequence Structure

3176 Words13 Pages
Sequence Basically in a sequence structure the action leads to the next ordered action in an encoded/programmed order. Sequence can include any numbers of actions; however no actions can be missed or skipped in the sequence. When the program runs it must execute each action in order to be not missing or skipping an action. Sequence, selection and loop are the main vital structures used to solve any logic problems in programming by forming algorithms. Iteration An iteration which is a processor loop that goes through a set of guidelines or commands that gets executed over and over so gets repeated again. Iteration is moreover one of core 3 simple programming constructs. Iteration comprises the utilization of 2 variables that are known…show more content…
This process is exactly the same as the section statements if its correct so true the code within the body of “while loop” is executed by that I mean the code inside the braces. And afterwards the test expression is checked to see if the test expression is true or not and the procedure will continue until the expression itself becomes incorrect false. While loop While loop and do while are used quite also in programming while loop itself executes a function that is specified by the programmer and it will keep on going on until the function is true itself. What while loop does is firstly it tests the specified/given instructions by the user/programmer and then it performs the function. /*C program to demonstrate the working of while loop*/ #include <stdio.h> int main(){ int number,factorial; printf("Enter a number. "); scanf("%d",&number); factorial=1; while (number>0){ /* while loop continues util test condition number> 0 is true */ factorial=factorial*number; --number; } printf("Factorial=%d",factorial); return 0; } – Example of while loop taken from internet Do while loop Now moving on to a do while loop a do-while loop is a kind of loop which is some sort of control statement the kind of a loop which has test at the bottom rather than the top like other The syntax for this loop is Do { Statements } while (condition); The job of the do while loop firstly the statements are
Open Document