"C Made Easy: An Introduction to the C Language"

                                                   Heyyy Magnetz ….!


Welcome dear magnetz in our previous article you learn how to install the C compiler and programming software according to your present Operating System, if you don’t read till now then please click on the below link and read it at least once.

POST LINK

Introduction to C Programming language: -

C is a general-purpose, high-level programming language created by “Dennis Ritchie at the Bell Laboratories in mid 19’s (1972).”

It was created as a low-level programming language that could be used to write the applications, 

Operating system.

This is a special language and is also known as the father language of all other programming language like C#, python etc. it was designed as simple, efficient, and portable. And also it gains popularity rapidly in the early years of the computer industry.

History of C Language: -

The history of the C language is very interesting for to let us to discuss it.

As we discuss it early the c language is developed in the 19’s by Ritchie at Bell Laboratories of AT&T (American Telephone & Telegraph).

Dennis Ritchie is known as the Founder of the C language. It was developed to reduce and overcome the problems of previous languages such as B and BCPL.

Generally, it is the implementation language for the nascent Unix Operating System.

C language has a pre-defined programming Structure by which the programmer can program their given task properly and effectively, the structure of C language follows: -

Structure of C Language: -

<Header file>

<Main Function>

{

Variable declaration.....;

Main body;

(which contains all the codes and concepts)

}

Let us understand it by an example, so for understanding the structure we are gone see a working C code of Addition of two numbers.



#include <stdio.h>                                                                                                   <Header file>

void main()                                                                                                                <Main Function>

{

int a,b,c;                                                                                                         <Variable                                                                                                                                            Declaration>

printf("Enter the value of a");

scanf("%d",&a);

printf("Enter the value of b");                                                                    <Main Body>                                                  

scanf("%d",&b);

c=a+b;

printf("addition is %d",c);

}

So the main parts of our Structure are as follows: -

Header File: - it is a storage that consists of a huge and rich C library that comes with a .h extension, which helps us to access other’s code into our code. There are multiple header files used in c language like <stdio.h> which stands for “Standard input output header file, <math.h>, <string.h>, <conio.h>, e.t.c.. each one of them has different works.

Main function: - the main function is the entry point of any programming language it is used to display the code on your computer screen and from this point, our main code and concepts are started.

Variable Declaration: - in C language variable needs to be declared (The variable is like a container that stores values) before the code is started and this variable is declared after the “{“ brackets with their datatype ( Datatype tells us which type of data is gone used in our code like where it is Integer value or Character value or Float value)

Main Body: - this is the main working space of our code in this part all the codes and concepts were written.


Thanks for reading…!









Post a Comment

0 Comments