Let's Get Introduced With C



Why C is important?



When it comes to programming, the first programming language we can all thought of, and have heard many times being from a programming background is C. Let's start with this basic programming language and take one topic at a time, we will cover everything about C. So, brush up on your PCs and laptops and get ready to code with us.


Before actually going with the C coding, we need to know some interesting facts about C and one of the facts is what is C and why it is so important.  


C is a middle-level programming language because we can make high-end software using C as well as it can access hardware directly. Many core libraries, MySQL and Oracle Databases, many Device Drivers, and many web browsers include a major portion of C coding. Many well-known operating systems like UNIX and LINUX are written in C language. 


Thus, it is clear from the above applications that how necessary is it to know about C and not only get the theoretical knowledge but also get to code in C and then make a real project on C as well. 


So, for understanding how C comes up as the most popular language, let's go into a quick overview of C. The first programming language developed as BCPL (Basic Combined Programming Language) by Martin Richards which is although not in use, has created a large impact as the programming world in which we are living today is all because of BCPL only after which B programming language was made by Ken Thompson in 1969. 


After three years of constant work, Ken Thompson and Dennis M. Ritchie made the C programming language and it was initially not made for general purpose but was developed for making the UNIX Operating System. This language was developed in AT&T‟s Bell Laboratory of the USA in 1972. 


After getting a brief insight into C, we have to clarify our concepts about certain keywords like Hardware, RAM, Processor, Hard Disk, Software, Operating System, File, Folder 

and we have covered all these things in previous blogs, so do check out those blogs to get a better insight into upcoming topics. 


Now, let's begin with the actual working of a C program which is also known as the software process of C. 


Firstly, we make a C file by giving an extension of .c to any text file. Then, the preprocessor processes the file and includes the header files in it. Then, the work of the compiler comes into play and then the library files get added to the object code created during compilation by the linker. Then, that object file is transferred to the loader and the program finally gets included and the output is shown. You will get a more clear insight from the image below.


Smallest Unit in C: Identifiers

We know how a file is made and how the program gets executed. Now, let's begin with the actual C language. Starting with any language, we always start with the smallest unit of that language to understand everything step by step. As we have alphabets as the smallest unit in the English language, we have identifiers as the smallest unit in the C language. 


Now, what is an identifier? It is actually divided into three parts which define it well. 


1. Constants:


• Primary Constants: Integer(2, 3, 1000, 100000), real(2.34, 5.777, 9.00), and character(a, b, '7', 'h' any number can also be a character but it has to be in single quotes) constants are three types of primary constants that exist in C.


• Secondary Constants: Array, Strings, Union, and pointers all are secondary constants about which we will be talking in coming blogs. 


2. Variables:


Rules for defining a variable name:

  • No variable can start with a number but we can add numbers after an alphabet.  
  • A variable can start from any alphabet, or underscore(_)
  • A variable can be of infinite length 


3. Keywords:


These are a set of predefined words which are already defined in the C language. We have 32 keywords in C and the list is as shown below in the image. 


Instructions 



As in the common language, what do we actually mean by instructions? Giving commands, right? And making the other person do the work. Similarly, in C instructions are the program statements through which we give commands to the computer to perform that specific task. 


There are four types of instructions that we give through our program: 


  • Data type declaration instructions:


Ex- int a: We are giving instructions to the computer to create a variable of int data type. 

float b: We are giving instructions to the computer to create a variable b of a float data type. 

char c: We are giving instructions to the computer to create a variable c of a char data type. 

  • Input-Output Instructions:

  • Arithmetic instructions:

Ex- c = a + b, 8*7, 9-6 etc.


So, let's sum up what we learned today and how we have improved our knowledge in the C language. Starting with what is C and why should we learn this language, we go through the history of this language. Then, we started with how the C program is executed and is the smallest unit we have in this language. After getting some deep knowledge about identifiers, we finished our blog with a little insight into instructions.


Let's meet in the next blog where we will dig deeper and get thorough with our basics of C and learn how to write a simple C program. 


Keep learning! Keep coding!



Comments

Popular posts from this blog

Your First Babystep In The World Of Coding

You spend more time commuting than giving a self-talk

Freelancing- a plethora of opportunities