C Programming Tutorial – Basics

c-programming-tutorial

This is one of the posts from the series of posts from C programming tutorials. These series of posts are designed for programmers to learn C programming language from scratch. This tutorial will give you enough understanding on C programming.

This language was developed in the year 1972 at the Bell Laboratories by Dennis Ritchie. C was created with the aim of developing UNIX Operating system. C is one of the most widely used computer language. C programming language is always compared to Java which is also the most used programming language.

Before starting with this series of tutorial pots, you should have a basic understanding of the programming languages and its terminologies.

Environmental Setup:

Environmental setup is one of the most important things to do when you start learning any new programming language. This helps to compile and execute the program while you read these tutorials.

To setup an environment fo C programming language,  you need two software tools available

  • Text Editor
  • The C Compiler

 

Text Editor:

Text editor is used to type a program on your computer. There are many editors which are freely available for download, you can use any of the editor. For example, Notepad ++ or Notepad for Windows OS, Vim /Vi or Gedit for Linux /UNIX OS and so on.

The files we create using this text editor will contain the code and are called as the source files. These source file for C programming language should have an extension .C.

Before you start with the programming, be sure to have a text editor and a compiler. Write a source file  with .c as the extension and compile it, finally execute it to get an output.

Compiler:

In the previous section we learn about how to write a source file in C, but this source files are in human readable format and computer is unaware about the code you written. To make it machine readable it needs to be compiled so that CPU can execute this file as per the code written.

Here compiler comes into picture; compiler compiles the source file and creates a final executable file. Based on the operating system you are using, you can chose a compiler for you. The most widely used compilers for Windows are Turbo C/C++ and Microsoft Visual Studio C/C++. Apple Xcode for Mac OS X,  Tiny C Compiler for Linux.

To install Turbo C/C++ follow the instructions given in this post.

 

C Programming Overview:

C programming was developed in 1972 a Bell labs by Dennis M. Ritchie. C programming is a general purpose, high-level language. In 1978, Brian Kernighan and Dennis Ritchie produced the first publicly available description of C, now known as the K&R standard. The UNIX operating system, the C compiler, and essentially all UNIX application programs have been written in C. C has now become a widely used general purpose language for various reasons −

  • Easy to learn
  • Structured language
  • It produces efficient programs
  • It can handle low-level activities
  • It can be compiled on a variety of computer platforms

Facts about C:

  • C was invented to develop an operating system called UNIX.
  • C is a successor of B language which was introduced around the early 1970s.
  • The language was formalized in 1988 by the American National Standard Institute (ANSI).
  • Today C is the most widely used and popular System Programming Language.
  • Most of the state-of-the-art software has been implemented using C.

Why use C?

C was initially used for system development work, particularly the programs that make-up the operating system. C was adopted as a system development language because it produces code that runs nearly as fast as the code written in assembly language.

Some examples of the use of C might be:

  • Operating Systems
  • Language Compilers
  • Assemblers
  • Text Editors
  • Print Spoolers
  • Network Drivers
  • Modern Programs
  • Databases
  • Language Interpreters
  • Utilities

C Programs

A C program is a source file containing line of code which is written in a text file with a extension .C, for e.g. hello.c. You can use any of the text editors to edit the source file.

mm

About Shrikrishna Parab

Shrikrishna Parab is Co-founder at TechNirmiti Solutions. He is a researcher in the field of Computer Science and Technology. He is 25 and lives in Goa. You can Follow him on Twitter, Facebook and Google +.

2 thoughts on “C Programming Tutorial – Basics”

Leave a Reply

Your email address will not be published. Required fields are marked *