Sunday, 10 August 2014

Whats a Computer Program?

A computer program is a list of chores, that tell your computer what to do.

The first program I learned, and the first program most books will teach you, is to print "Hello World" on your computer screen, in a window.

The are many computer languages out there, but here's what a C program looks like, if you were to try and print "Hello World" on your computer screen.

/* Hello World c program */

#include<stdio.h>

main()
{
    printf("Hello World");

}

* although you will have to use a compiler to execute the program, here's how it looks

* notice how the top line *Yellow World c program* is different from the finished product?

Well the top line is only a comment reference, for when you come back later. This allows you to, easily identify your programs function.

For example: * Door knob turns*
That comment let's you know, that the purpose of that particular program, is to turn the door knob. ^_^ see, simple.