My first programming language was C. I had a lot of fun creating programs that used logic to do different things. None of the programs I wrote were too complicated, they all ran in the main() function, and they were never over 200 lines of code.
For the layman, the main( ) function is where all programs start. Anything outside of the main function must be imported before the code runs or called when the program is running. So all of my programs looked like this:
#import stuff
myfunction(){
x = 5
return x; }
void main() {
int x = 0;
while x < 5
x = myfunction(x);
y=x;
print y; }
So all this pseudo-program does is creates a function that adds five to whatever number it is given and returns it. Since my while loop checks to see if x is less than five, it should only loop once. Each time through the loop the value of x is given to y and the value of y is printed to the screen. So the output of this program should just be the number 5 since the next time it checks, x will not be less than five and it will skip to the next thing which is ending the program.
Procedural programming is good for things where the data and code can intermingle together, but later we will see what happens when you want to keep your data and your code separate...