UPDATED:

How To Make A Simple Calculator By C Happy Coding.......... Happy Coding.......... Happy Coding.......... Happy Coding.......... Happy Coding.......... Happy Coding.......... Happy Coding.......... Happy Coding.......... Happy Coding.......... Happy Coding.......... Happy Coding.......... Happy Coding.......... This blog is under construction!!!!
Namecheap.com

Friday, February 26, 2016

First program in C

We are going to write our first program in C a compiler.I write a program like this:

Code:

/*This is our first program.*/

#include <stdio.h> 


int main()         

{
    printf("Hello Worid.");
    
return 0;
}

Output is: Hello World.

coder mania bd

When i run this program it shows me "Hello World".

Why and How it works?

At first i wrote a comment between /*.......*/.The compiler do not read any comment in a program.You can write comment in a program for making a program easily readable to others or our next development.You can write single line comment and multi-line comment.For single line comment you have to use // this and for multi-line comment you have to use /*........*/ this.

After that we used #include <stdio.h>.#include means i linked something in this program from C library.Actually i linked a header file.C has many header file.All file have specific uses.The <stdio.h> file is for input and output operation.<std(standard)i(input)o(output).h(header)> .

Then i wrote int main().int means integer and the main() is a function.C has many functions but main() is the principle function for C language.

{...statements.....},The second brackets keep the statements.printf("Hello Worid."); this is a statement.Every statement must have to end with ; semicolon.

Now printf("Hello World."); printf is a function.It helps the program to give output.After the printf,there are  two quotation mark between two braces.Between the quotation mark you can  write anything which you want to show on your console.

return 0;This statement tells the program to end his works.

This was our first program.Many programmer start their programming with this program Hello World.If you face any problem to understand then feel free to contact us.You can comment here or visit our Facebook page Coder Mania BD and Facebook group .
Thanks for being with coder mania bd.

No comments:

Post a Comment

Namecheap.com

Popular Posts