Introduction to C programming

Introduction to C

Hey guys take an example of printing of a document how would a computer perform printing if we select print option shown on the screen? 

How would a computer work and run?

Computer need instructions to run and perform tasks. Instructions are written by human and set in the computer. So that a computer works. Set of instructions is called a Program and set of programs is called a software. Yes, the software is really essential to run the computer. 

Then how can we write the software. A software can be only written by computer programming language.  One such Computer programming language is C programming language. 

We have many codes or programming languages to write a software. Programming Languages are mainly divided into two types. They are Low level language and High level language. 

Low level Language::

Low level Language is referred as computer's native language. There are two types of low level languages. They are Machine code and Assembly language. 

(i) Machine code::

Thus language consists of only 0 & 1s and it is directly understood by the computers. This is very difficult to write or debug. This is also known as Binary Language. 

(ii) Assembly language::

Assembly language is a intermediate language between high level language and Machine language.  Assembly language use some mnemonics (short abbreviations) to instruct the computer. Each mnemonic code has a instruction.

LDA - Load value from a memory address 

STA - Stores a value in a memory address

ADD - Adds value in a memory address

SUB - Subtracts value held in the memory address.

MOV - Moves the contents to one memory address to another memory address


High Level language::

A high level language is a advanced programming language. It is a Machine independent and resembles English language with a predefined set of rules and symbols.

Eg:: Pascal, COBAL, C, C++, Java, Python etc

Introduction to C::

C is a computer programming language. C was invented in 1972. It is the oldest programming language; even we are using it today. 

          C was written by a person called Dennis Ritchie at Bell Telephone Laboratories between 1972 and 1973 for designing UNIX operating systems. 

History of C programming::

C is derived from the earlier language B. B is derived from Basic Combined Programming Language(BCPL). BCPL is derived from ALGOL (ALGOrithmic Language).

The name of C is given to this language because it is derived from B.(C was successor of B)

Programming Language 
Published year
Develoed by
ALGOL 1960 International Group
BCPL 1967 Martin Richard
B 1970 Ken Thompson 
Traditional C 1972 Dennis Ritchie
K&R C 1978 Kernighan & Dennis Ritchie
ANSI C 1989 ANSI Committee 
ANSI/ ISO C 1990 ISO Committee 


Where do we use C?
  1. For developing desktop applications
  2. For designing Operating systems and Compilers. 
  3. Operating systems such as Apple’s OS X, Microsoft’s Windows, and Symbian are developed using ‘C’ language. It is used for developing desktop as well as mobile phone’s operating system.
  4. For developing games and browsers.
  5. Most of the applications of Adobe are developed using C language.
  6. Used to write embedded systems. 

Don't be afraid of C language by end you going to know all the basics of C language. 

Why was the purpose behind invention C programming language?

C programming language was invented to write an operating system called UNIX. UNIX was totally written in C programming language.

Do we use C still Now?
Yes, we use C still now. 
C is used in writing Operating systems. Microsoft’s Windows kernel is developed mostly in C. Mac, Linux and Android Operating systems are mostly written in C.
C is used to write Databases. Most popular databases, including Oracle Database, MySQL and many more are written in C and C++.
We use C language to write compilers and interpreters . C programming has many advantages. 

Let us see the beauty of C programming::

Now I need to get the name HELLO WORLD! on the screen. Now I'm writing a program to see HELLO WORLD! on the screen. We need compiler to run the programs. 
What do compilers do? Why do we need compilers?
 Actually computers do not understand any programming language. It only understands Binary code i.e computer understandable language  so we need a compiler to covert the programs into computer understandable language.  So we use compilers. 

Set Up an environment for C coding::

Setting up an environment for C coding means installing required compiler for performing C programs and Execute them. There is no universal compiler for C. There are many C compilers offered by many institutions. Install Microsoft Visual Studio Express or even  MinGW for Windows operating systems. Install Xcode if you are using Mac. For Linux install gcc. There are many C compilers available in Google Playstore for Android Phones. There are online compilers available too. The below one is  Basic program in C.

Click Execute to see the result.

In the program, #include is a preprocessor directive.
is a header file. int main() is a function from where the execution of the program begin. printf(""); is a formated output function that puts the data written inside the double quotations " ".

Don't worry about this all. I will clearly explain this all in coming posts. 

Post a Comment

0 Comments