Learn Computer Programming - Basic C Programming (Part 02)

https://acmtt.blogspot.com/2018/11/learn-computer-programming-basic-c-programming-p2.html
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.
  • Java
  • PHP
  • JavaScript
  • Python
  • Objective-C
  • Ruby
  • Perl
  • C, C++ and C#
  • SQL
  • Swift
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.
  1. Header file
  2. Main () function
  3. 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

OK Now, running a program should start the programming part. You can start C programming with any compiler. Turbo C, codeblocks anything. If you do not have codeblocks software on your computer you can easily download it from here.

http://www.codeblocks.org/downloads

In this website you can download binariae release and install it.

If code-blocks are installed, open a new project and you see a window like this.

Learn Computer Programming - Basic C Programming (Part 02)

From there click on the Console application and save the location by typing the name of the program and the new window appear to write the program.

Or you can also open a new project from the file. Now write a program like this :




By typing this and clicking on the top green button you can see the program on a separate screen-

I am a C programmer.

This way you can easily write your first program. Now hold that you want to write two lines. What will you do? Very simple. The printf will be written twice.




I am a C programmer, This is my first program, there are two line outputs

But if you want this line one after another like
I am a C programmer
This is my first program

In that case you need to add \ n to the end of the first line. \ n means new line.




Well, before second line if you enter \ n  will you get your desired output? Practice yourself.

In the beginning, please typed the line repeatedly without copy paste. And in the next phase, we have come up with some more common topics of C programming. Again, I am going to say that I will try to give some basic concepts of basic programming in C ++, through a few parts. Through this you can not learn programming, I know. But it also knows that after reading all the parts, there might be some interest in learning programming. And if you are interested, you will learn as first as you don't know. 😀

Happy Programming ..


Load comments