Subscribe For Free Updates!

We'll not spam mate! We promise.

June 9, 2012

Printing Hello World

|

C is the most widely used programming language. Here I will share to you the very basic of C programming language, the printing of "Hello World".


See the code below:



#include<stdio.h>

int main ()

{

printf(“Hello”);

printf(“World!\n”);

return 0;

}



\n - Newline. Position the cursor at the starting of the next line.

\t - Horizontal tab. Move the cursor to the next tab.



*** Since you were not able to put a "\n" on your first printf, the "World" were still on the same line.


#include<stdio.h>

int main ()

{

printf(“Hello\n”);

printf(“World!\n”);

return 0;

}





#include<stdio.h> - the header of the program, this line tells the preprocessor to include the contents of the standard input/output header file (stdio.h)

printf - part of the information and declarations used by the compiler when compiling standard input/output library functions.

int main () - is a part of every C program. The parenthesis is a program building block called a function

left brace - must start the body of every function

right brace - must end the each function

0 comments:

 
Copyright © . ZaKyri NewsTrick - Posts · Comments
Theme Template by BTDesigner · Powered by Blogger