Sunday, August 4, 2013

C Programming- The First Program

Now I am going to write my first program in c programming language.

First of all open codebolcks. Then click File-->New-->empty file. At first save by ctrl+s. Give a name.I give it first_program.then type
#include <stdio.h>
this is the header file of c program. Remember to write this in the first.

==>Now this is enough for you to know about header file. I will explain it to you later, why i have written it. By doing this you will get into programming steps by steps. Now just believe me, and do what i am saying.

secondly type
main ()
this is called main function. In c programming language every thing you need to write in function. you have to write logic in the function. Then it will process. Function can be different type int main() , void main () ... i will discuss it later.

thirdly type
{
    
      }
In the middle of {} you have to write your logic/code/order/instruction. i use different word so that you can get it easily. after getting the c programming language you will learn about yourself. I just want to give you the very beginning concept.

fourthly type
printf("I am learning");

printf is a library function. There are many library functions for different benefits. Printf library function will print anything " " you write between this double quotation.

the program will look like



Now click "build"



If it shows process terminited with status 0,
o errors,0 warnings.    Then you program is correct.
(congratulations you can write a program :) )


Again click "build" then click "run"
now a black screen will appear.and u see the line
I am learning (what u have written between " " the double quotation.



 If it shows error when you click "Build"



try to find out the mistake, and build and run again.
Remember to be a good programmer is not easy. You need passion. So don't give up hope. Just hook up. You will be succeeded .



No comments:

Post a Comment