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.
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,
Recommanded: How to Learn C Programming Language - Lesson #1
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