[C Tutorial 1] Introduction to Programming
In these tutorials, we’re not really getting into the whos & whens – our one and only aim is to write efficient programs in C. For everything else – there’s Google.
Now, you could be here either to pass an exam – get a degree or you could be here for the love of code – to make something new. Make sure your’s is the second reason. If not, make it so.
What is a Program? Why do we need to program at all?
Some people wonder(believe me, they do) – what’s with this code stuff.. why do we really need to write a program at all? The answer is simple – even simpler if you know how a computer works. A computer or any electronic system for that matter, is made of a large number of switches or gates – When a certain combination of gates is created – an operation is performed. This combination is made by opening and closing appropriate switches.
Since a computer doesn’t have a mind of its own – we need to give instructions to the computer in order to close and open the switches. This set of instructions is called a program. A program is essentially a blueprint for this combination.
What is a Compiler? Which compiler should be used for C?
Since our computer only understands binary – we need a “program” to translate the code written by us in a programming language of our choice – to binary. This program is called the compiler. The programs written by us are a “higher-level” (user-friendly or rather human-friendly) than what the computer understands.
You can download any of the C compilers available for free. Try Dev C++ (Download Link) or Code::Blocks (Download Link) to start with – and you can later switch to a compiler of your choice. A list of all the C compilers is available here.