The first question that should come to your mind is:- Why should I learn C?
- It is the first language that generally comes to mind when you begin to learn professional programming.
- It is a general purpose, cross-platform, block structured, procedural language.
- It is small and easy to learn. It has only 32 keywords!!!
- It combines the flexibility of assembly language with the structure of high level languages.
- C programs are portable.
So lets start learning, folks!
The first thing that you are going to need is an IDE( Integrated Development Environment). An IDE is an environment that provides the compiler and the editor for writing, deploying, testing and debugging programs. For this we will use CodeBlocks.
Go to Google and search for CodeBlocks. Select the link that says codeblocks.org.
Go to downloads and select the Operating System for which you want to download the setup file.
Download the file from either SourceForge or BerliOS.
I chose Windows, so I am going to explain the next steps for Windows. Run the downloaded setup file and follow the steps according to the screenshots given.
Now that CodeBlocks is installed, it will run and the interface will look something like the one given below
Now that we have installed CodeBlocks, lets just run a very simple program and test it to check if its working or not. The first thing that we have to do is to open a new file for us to write the code in. For this,
- Go to the File menu
- Hover on New and the Select File
- In the window that comes up, select C/C++ Source File and hit next
- In the next window Give the file name with full path and hit finish
Now, write the code as given in the screenshot.
Next, Go to the Build menu and hit Build. what this does is that it compiles the code, checks for any syntax errors and gets it ready to run. Next hit the green Play button. That is actually the Run button. A console window should open up that shows the sentence written inside the printf function.
What is written inside the code will be explained in the coming tutorials.