If you want to a good programmer then tis is most important to know c programming language.
C is a very simple from other language it is widely used by software developers around the world.
You can easily learn c program just read our pots carefully and practice regularly if you don’t practice you can’t learn c programming language so it is most important to practice the programs regularly.
For learning c must need a software called c compiler. There are many compiler for c language like Code blocks, Turbo c++, ANSI.
You can use any c compiler for run c programs for my suggestion you can use Code Blocks it is very easy to use and it’s an open source software so you can easily download it from the official site and used to run the c programs.
Download the latest version of code block from the link and install on your computer or laptop. Install process is same as the other software.
Here are the screenshot of code block interface.
c compilar code block
CodeBlocks

Ok if you complete the download and install step then open CodeBlocks software.
Click on File > New > Empty file.
Now click File > Save file or use shortcut key Ctrl+S
Give the file name what you want but file type must be C/C++ (mind it).
Ok it’s time to write our first code and run.
Today we learn how to print something on our screen.
Let’s write this code on CodeBlocks

c programing printf code
code











Now click on Build > Build (Compile) it is necessary to know there any error in code or not if not it will show 0 errors 0 warnings.

c programming tutorial
Build
Here are the screenshot of Build log.

c programming tutorial compile massage

Output is TechHelpZn.
c program run

Now I’m define the above code

1. In line no 1  #include
This is the pre-processor command that comes as the first statement in our code.
All pre-processor commands start with symbol hash (#). The #include statement tells the compiler to include the stander input/output library or header file (stdio.h) in the program. The stdio.h (stander input/output ) header file contain function for input and output data like reading values from the keyboard and printing the result on the screen.

2. In line no 2 int main ()
int is the return value of the main function. Main() is define here are the main function of the program.

3. { } our all program codes or statements are written in this two curly brackets.

4. printf(“ ”);
This function display the massage that we write in the double quotes (“ “).
At the end of the statement use colon (;) to indicate that here is the end of statement.

5. return 0;
This is return comment that is used to return the value 0 to the operating system to give an indication that there were no error during the execution of the program.

It is the basic structure of c language in the next tutorial we discus about header files and data type in c.   

0 comments Blogger 0 Facebook

Post a Comment

 
TechHelpZn 2013. All Rights Reserved. Design by Chiru
Top