This series of tutorials are for those who are beginner and want to learn C programming. If someone knows about computer programming that's good but if not, this tutorial will guide you to learn about computer programming and then we will start learning C programming.
Computer doesn't know English or other languages but there are many languages computer can understand : known as programming language. Example: C, C++, Java, PHP etc. Well, Computer (actually the processor) don't even understand them but only machine/binary code/language. But its tedious tasks for human to write program in binary/machine code. So there are some intermediate or high level languages (C, C++, Java and others) which are for human to write code. There are some programs which translates code from those intermediate languages to machine/binary code. We call this programs compiler or interpreter. By the programming languages we generally give instructions to computer to perform some specific tasks, these instructions are combinedly called as 'Program' or 'Computer Program' and the instructions are called as 'Code'. So computer programming is to write instructions for computer in any programming language. These instructions can be written by following the structure of that programming language.
So the basic need to write a computer program is to decide what is the task. Then writing the code. When we run the program only then computer can get those instructions and will perform the task if everything goes fine. So a new thing comes up "running the program". Running the program is the process to execute the compiled Code. Compilation is the process to find out whether the instructions are syntactically okay and follow the standard and structure of the language. We will cover these terms in our next part of this tutorial.
A Simple Computer Program
Let us think a problem: We want our computer can add two numbers. Generally there are programs come with operating system named as calculator that can do this simple task but we want to make a computer program that can add two numbers. Firstly, our program needs these two numbers we want to add. When these numbers are supplied to our program the instruction of addition will add the numbers and finally shows us the sum. The algorithm for this task is
Algorithm is the step by step solution of a problem(Here addition of two numbers). The picture shows the flow chart(graphical representation of an algorithm) of addition of two numbers.
Let the numbers be 15 and 7. So the addition of these two numbers will be 15+7=22. Our task is to write the instruction of addition of two numbers. The addition instruction in C language
sum = number1 + number2;
See the instruction is ended with a semicolon, we call this complete instruction as statement. So this simple statement can produce the summation of number1(=15) and number2(=7) as sum(=22). When the sum is produced we will simply write a statement that will show the sum in the computer window. So we have the idea of a computer program.
Computer programs have zero or more inputs and zero or more outputs. The inputs can be various type, for the addition program input was two numbers and output was the sum.
In our next tutorial will learn about "C Programming Language" with an example of Hello World program.