Introduction to C Programming

Share This Post

Some days ago, I thought of a better thing to do over the weekend during this summer. Deep into my thinking, I decided to be writing short lessons on C programming.  The content of of this lesson is highlighted  below:

  • Variable
  • Operators
  • Conditions and Loops
  • Functions
  • Recursions
  • Pointers and Arrays
  • Structures and Unions

I will begin by discussing the history of computing in this article. In the early days of programming, people code in binary format which are machine understandable syntax. For example, to write hello world in binary, the code will look like the image shown. Now consider we want to write a program to add to numbers in binary. This is very simple to even newbie in programming but that would be difficult to do in binary for even experts.  This led to the development of assembly language. In assembly language, there is no binary, codes are written in a much higher level syntax. If this is the case, why do we need to study another programming language like C? Well, assembly languages are not portable. They will run on a machine that it is written on and not work on other machine. In addition, they are also difficult to write and understand. Writing simple programs like addition of numbers take more lines of code in assembly language than modern high level languages. The need for  portability and ease lead to the development of modern higher level languages such as C. For example, the syntax to add two numbers in most languages look like:

Result = a + b

This command is easily understood by humans. However, machine do not understand this type of syntax. So, there is need to convert human understandable expressions to machine understandable code. This is achieved with a compiler. Compiler converts the higher level human expression to machine code in binary.

In subsequent lessons in this tutorial,  we will dive deep into the structure and syntax of C programming. We will discuss more features of C programming and then write our first C program (Hello World!), in our next lesson.

More To Explore