02 - C Execution Environment

In this chapter we shall download the software which is required to write, compile and execute C programs which we are going to develop. This chapter will guide you through a step-by-step procedure of downloading and installing the software in your machine. Please follow the procedure so that you can easily setup the environment. I have enlisted ten easy steps to accomplish this goal.

Step 1: Open any web browser of your choice. In the search bar type download turbo C++. Your browser will enlist number of links from where you can download this software for free. Similar scenario would pop-up on screen. You can use any other software for development.

Step 2: Choose any link of your choice to download the software. Make sure you are downloading the flavor of turbo C++ which is compatible with the operating system running on your development machine. Since I am using a windows laptop so I would choose the link which supports my development machine. When you click on any of the links listed above similar scenario would appear on your screen. You can choose any compiler of your choice. For this tutorial I would be using Turbo C++ because C is usually the first computer language introduced to students in schools or colleges. I would download this software from softpedia.com as I have used this before. You can choose any other third site, you trust, to download the software.

           Figure Click on any one the links to download the software

Step 3: Click on the download link to start downloading the turbo C++. When you click on download click similar scenario would appear on your screen.

                     Figure After clicking the download link

Step 4: Choose on any one of the download mirror to start your download. Similar scenario would appear on your screen depending upon the website you choose to download the software.

                    Figure After clicking on download mirror

                             Figure After download is complete

Step 5: Download would finish automatically. After the download is complete click on the exe file and similar scenario would appear on screen.

If you want it to run later you can do so. For that go to your downloads folder or to the folder where your downloaded files are automatically saved. Windows usually saves the downloaded files on Downloads folder automatically. Scenario should look similar to the following snapshot.

      Figure Turbo C++ downloaded in the Downloads folder

Step 6: When you click on the exe file it will pop up installation wizard. Similar scenario would appear on screen.

Step 7: Accept the license agreement which will appear after you click on next button. Screen would look similar to the following snapshot.

Step 8: Wizard would ask you to choose destination folder. Let be default if you do not want to customize the folder where you want to install the software

                                             Figure Default destination folder

Step 9: Click on the next button and then finally click on the Finish button which will appear on the wizard.

Operating system would automatically install it you and then a read me document would appear on your web browser as it did when this software was installed on my laptop. It would look similar to the following snapshot.

Step 10: After complete installation you could see a shortcut icon on your desktop. Your desktop would have a icon similar to the snapshot listed below.

After setting up the execution environment we can start programming in C language. We will use Turbo C ++ for developing C programs. Here comes a short sample C program:

                                  Figure Sample program

                         Figure output of sample program

Now we shall introduce the basic structure of C program in brief.

Basic Structure of C Program

Preprocessor directives: These statements are identified by symbol#.These statements indicates the preprocessor to include header files and symbolic constants.

Global declarations: These declarations are valid for main function and all other user defined functions. Variables are called global variables and/or functions. These declarations are to be made before the main function.

main() function: This function is the main function of every program. This is the function where program starts execution. This main function exists for each and every C program which should not be terminated by semi-colon and it is responsible for calling library functions and user defined functions. { indicates the beginning of main function and } closes the main function. Braces also do the same thing for user-defined functions.

Declarations: In this section, variables, constants, etc are declared and initialized.

Statements: Statements include instructions to perform specific operation. These statements may be arithmetic statements, input-output statements, etc.

User-defined functions: Functions are the sub-programs. These group of instructions performs a specific task.

Following diagram shows the basic structure of C program.

                            Figure Structure of C program

We are concluding this chapter with this. In the next chapter, you will be introduced to the data types, tokens and keywords used in C language. Thank you.

Like us on Facebook