Thursday, October 1, 2015

How to write "Hello World!" with C programming language

In the previous post, I already explain about C programming language and how to download and install the compiler. Now, I will tell you about how to write "Hello World!" with C programming language.

First of all, open the compiler. Then, click file -> new -> choose empty file

Write #include<stdio.h>
#include<stdio.h> is a statement that tells the compiler to insert the contents of stdio (STanDard Input and Output) at that particular place. 

Write int main() {
int main is the declaration of function.

Write printf("Hello World!"); .
ptintf is function that used to print things in quotes mark,

Write the return 0. 
Return is the value to exit code of your program, and the 0 exit code is for make the program's execution was successfull.

Click build and run to save the program then run the program.

Choose the directory to save your program. Give name to your program. After that, save the program.

This is the result. It will print Hello World!

It is the example of error code. If you forget the little thing like quotes mark, semicolon, brackets, or anything else it will make the program error. 

This is the tutorial video how to write "Hello World!" https://www.youtube.com/watch?v=A7h4R_CQ6ws

That's the tutorial how to write "Hello World!". Have a great time with coding guys!

No comments:

Post a Comment