|Learn Computer Programming - Basic C Programming (Part 02)|
Learn Computer Programming - Basic C Programming (Part 02)
Basic C Programming and Programming Language
In our first lesson, we got a general idea, why and how a program work and how to be a programmer. In this Lesson we know about the C programming and how to start with it. But firstly let's see other programming languages for idea about programming Language.
- C, C++ and C#
Today we are going to know about the C programming that's very important for computer programming. Computer is worked by C programming, as we take decision and create solution, computer programming define the system of creating computer decision according by programming.
What is the need of programming language?
Programming language is a language that allows computers to work. Although the fact is that the computer only understands nothing except 0 and 1. Should the computer use all the directions 0 and 1? But then writing the program will become very complex.
It is a matter of confidence that in the beginning, using the program only using 0 and 1, but after the release of this problem, every instruction started using the metaphor (eg. ADD, SUB, etc). This is called Assembly Language. Along with this, Assembler is a software that converts metaphor instruction into auto machine language.
But there are problems with this assembly language. People who have sufficient knowledge about machine only they can write program. Then how do I or you?
For our convenience, developers gradually discover a little high level language such as C, C ++, Java etc. For this language you need to know some of about machine to write program.
Structure of C program
C is a mid-level programming language. There are three part of C programming.
- Header file
- Main () function
- Others Function
The C program is composed of one or more functions. Each C program has a user defined function named main (). A small C program can be written as :
It is good to say that if you type Main () in the place of main (), then your compiler showing it as error. In some programs in the place of semicolon, if you give comma or doesn't use semicolon then again you get error.
As you would like to give instructions inside the main () function, the semicolon must be at the end. Suppose you are trying to print a line. In that case, you have to use the printf () function.
As mentioned earlier, a header file is required to declare C program. The process of declaring header files,
add > on finishing of header tag