Responsive Ads Here

Sunday, July 31, 2016

How to Learn C Programming Language - Lesson #2

Hey guys, you know what programming is the heart of technology and technology is the most important thing in this modern era. Just think the importance of learning programming! Anybody can learn to code C and can participate in the competetion of invention new things. So, I decided to write a serial writting about coding.

C Programming Language

There are many languages to write a program. Here we'll start in C/C++ language. C and C++ are about to same. For that, we'll start in C and finish in C++ at last. As we'll write a program in C language, we've to use a C language compiler. It can be Code Blocks, Quincy or Turbo C++. Here we'll use Code Blocks. To download and install Code-Blocks click here,
To install the Code-Blocks softwere click here,

>>>How to Intall Code-Blocks.

How to Learn to Code C

We'll write the program first and then will try to understand it. Let's start our first program...

/*  Coding start  */

#include<stdio.h>
int main()
{
      printf("Hello World!");
      return 0;
}

/*  Coding end  */

This is our first program. Just now you've written it. So you're a programmar! :-D . Yeah, you've turned yourself as a part of programming world.

Let's have a look on the output of our first program. Here is this!
To understand well, revise the lesson one here,


Ok, now we'll try to understand the program. There are some divisions in a C language program. And it is definite for all C language used the programs.

  • First we need to type "#include" to start a program in C. What we are writting in the compiler, what are these? Actually, these are instructions. We input these instructions and compiler will make the result of these. "stdio.h" means standard input output.
  • Then we wrote the main function. "int" means integer.
  • Then we need to declare the variables. As it is a simple program and there is no veriable in this program, we'll try to understand it in the next programs.
  • What we want to show in the screen, we'll write these in the printf("") qouatation. Run the program and you'll see "Hello World!" in the screen.
  • Every statements are closed by placing ";" at the end.
  • After all the statements and conditions we've to write "return 0;" to close the program.
  • All the variables, statements and conditions will be in "{}".

                  No comments:

                  Post a Comment