What is C Programming Language?
C is a high-level, general-purpose, procedure-oriented programming language which was developed at AT & T’s Bell Laboratories of the USA in 1972 by Dennis Ritchie. It was used to re-implement the UNIX operating system. Because of its simplicity and reliability it started replacing the popular languages of that time like PL/I, ALGOL, etc. Having survived for more than three decades it’s popularity keeps varying along with newer Object-oriented languages like Java, C#, python, C++ and other procedure-oriented languages as well.
Why use C Programming Language?
An often debatable question that arises here is – “With C already being superseded by languages like C++ and Java, why bother learning C at all?” The call to C is quite close. Here are a few reasons why –
- A major portion of the trending operating systems like Windows, Unix, Linux still uses C because of it’s high speed of execution.
- There is a need of fast working systems with limited amount of memory in the microprocessors that power the smart devices like phones, washing machines, digital cameras, etc. C fulfills this primary need for operating systems and programs.
- Popular languages like Java, C++ are object oriented which has a lot of advantages to offer but learning C first will give a good hold over basic programming concepts.
- Many popular gaming frameworks(like DirectX) make use of C language. A game needs fast reaction to the inputs which needless to say, is provided by C.
Features of C Programming Language
C programming language comes with a great number of features that makes coding easier and simple to use. In this section we shall see a few features of C which make it very user-friendly and readily usable:
- Portability : This feature of C programming language refers to the fact that a code written in C can be used on other platforms too. In a more simple way, programs written in C can be run and compiled on other machines which almost no modification.
- Speed : Due to a varying range of datatypes and powerful operators, C programming language is found to be very fast and efficient. It is much faster than BASIC. C programming language is also known as the middle level language because it supports system programming due to which it is compiled at a faster rate than other high-level programming languages.
- Compact : C programming language contains many keywords with predefined functions which makes it handier to use C. Instead of using a dozen of lines of code, a simple word or two might perform the operation which we want.
- Modular Programming : Modules refer to the small parts of a large C program. This is an important feature of structural programming. Modules reduces the complexity of a program and makes debugging easier without causing any problem in the program structure because all the modules are integrated into the program code.
- Case sensitive : Case sensitivity refers to a language’s ability to differentiate between the upper case and lower case letters. C programming language is case sensitive which means that C treats ‘continue’ and ‘CONTINUE’ in a different manner. The reason is that UNIX is case sensitive and C was created to be used on UNIX.
- Extensible : C programming is found to be very extensive because it enables a user to produce new language features like new notations, control features, data structure, operations, etc. It allows us to change or modify the language according to our changing needs.
First C program – “Hello World!”
Why this Hello World program? This is only to explain the basic structure and syntax of C programming language. We will further learn a lot of syntax and programs in this tutorial series but to start let us make this most simple and basic program that I believe is written by every programmer in whatever language(generally his/her first language). So, let’s go through a simple Hello World Program to get a better insight of C:
An explanation of the various parts of the above program:
- #include<stdio.h> – #include is a preprocessor which is here used to insert header file stdio.h. We need to import these files as it includes some functionalities i.e. functions which are already written to be shared among various C programs. stdio.h is a header file which comes along with the compiler.
- void main() – is the main function which contains the set of statements to be executed. This is the method from where execution of a program begins. no matter whether this function is written in the beginning or end, execution will always start from main().
- printf()- is a library function which displays the formatted output to the screen. Further, we will see how to properly format the output and how to include various variables in the formatted output. Here we pass “Hello World!” as a string to it and it sends the message on the output screen.
An investment in knowledge always pays the best interest. Hope you like the tutorial. Do come back for more because learning paves way for a better understanding.
Do not forget to share and Subscribe.