Subscribe Us

How I learn C programming at home on online for free - smartduniya

Are You want to  learn C from the scratch ? .

 Today I'll be discuses  about basic structure of c programs. I will walk through the different sections which are involved in well structured C program.

 So let's begin now. every C program begins with documentation section.

 what this word documentation mean?

Like the name suggests, it basically contains information about program like what the program is about, author's name so that whenever so that user programmer would like to use it later.

What is c  ? 

c is nothing but a language. It is use to write program. So, C is a programming language .


Who created c programming language ?

C programming language designed and written by the a man named Dennis Ritchie.

Which organization created a standard version of the widely used c programming language in 1972 ?

C is a programming language developed at AT & T’s Bell Laboratories of USA in 1972 .

C programming language become popular not only programmers but also it become industrial language because this programming language is very reliable , can understand simple and easy to use .  


What is c programming used for ?

you would still need a good hold  over the language elements of c and the basic programming skills .

  • so it makes more sense to first learn C and then migrate to c++ , C# , java and so on.

  • Most of popular operating system like windows , Linux UNIX are written in c

  • At a times, one is required to very closely interact with hardware devices where c language sue most .

This section is followed by link section. This pointing to indispensable section. The word indispensable means that the section is absolutely required.

You can't avoid this section. This documentation section is an optional section. You may or may not have it in the program, but this link section you must include it in your program. If you do not have this section in your program and you compile your code, it shows compilation error.

So in order to avoid such kind of compilation error right at the beginning of your program, you must include this section in your program and what this link section really does is it provides instruction to the compiler to link the function from the system library.

I will talk more about the system library and function in another video. So for now what you need to keep in mind is you must include this section in your program to avoid the compilation error right at the beginning of your program and here comes the definition section .

In this section we declare symbolic constant .

What this symbolic constant is ?

 If you are completely a freshman in the field of programming language and you know nothing about the programming language, you must be wondering what this word symbolic constant is. Well let me tell you symbolic constant is nothing but a variable whose value remains constraint throughout the program. Its value doesn't keep on changing like the value of the general variable.

So , whenever you need to declare a variable which is a symbolic constant, we declare it here in the definition section. This is also an optional section. You may or may not have in the program.

It depends on the requirement of the program. This definition section is followed by global declaration section.

Well the word global suggests that whatever we declare here, it is available globally. What it means is if we declare a variable here, it will be considered as  global variable and it will be accessible to all the function not only to the main function but also to the function which are defined also the main function.

So  it also contains the proto type of the  function.  you need to keep in mind  is if we need to declare a variable which is to be used in more than one function.

How to Write C program?

we declare it here in the global declaration section. After this section comes main function, this section is absolutely necessary. You can't avoid it. You must have it in your  program. This section begins with opening curly brace “ { } “,  which marks the logical start of the program and ends with closing curly brace / brackets 

which marks the logical ending of the program and this section has two part declaration part and executable part. 

Declaration part contains the declaration of the variable which are used in executable part and executable parts should contain at least one statement.

whatever we write here within this opening and closing curly brace, each of those statements relate with the  semicolon. If you do not end each of those statements with semicolon  and you run your code compiler shows compilation error.

So in order to avoid compilation error, such kind of compilation error, you must end each and every of those statements with the semicolon. After this main function, comes the subprogram section.

This subprogram section is an optional section. It exists only when you when it exists only when we define user defined function .

Don’t forget to Subscribe our Blog to get update. Just put your email on subscribe box and hit subscribe button , next verify your email , it will be done.

You will get every single post when we will upload in Smartduniya.


How to write comment in C ?

How to write keyword, identifires in C ?

How to write Printf() function in C ?

Post a Comment