What Is A Computer Program?
A computer program is a series of instructions that must contain sequence, selection, or repetition.
Sequence, Selection Or Repetition
Sequence is when the instructions are read in list fashion. Selection would be when some condition is specified such as if a given field is equal to a number or other given field. Do this if. Repetition is when a given instruction is repeated over and over again until a given condition is met such as do this 100 times. Do this until.
In this picture (taken from http://php.net/) you can see the most common construction. This one is called a for loop. The loop means it will be executed many times. The for means for a given number of times. In the picture the dollar sign indicates that the number after it is placeholder for a variable number much like in algebra. The expressions are separated by semicolons. The first expression just establishes an initial value for the variable. The second expression might say do this until i is less than or equal 10. The value of i would be checked here every time the loop is executed. The last one is incrementing or storing the value of i in i . echo just means to print a value such as i.
This web site is made with Drupal, a PHP program.