Getting Started with C.

The C program is a set of functions. A C program always starts executing in a special function called main function. Here is the simple but famous "Hello World" program which prints "Hello World" greeting to screen.

#include
void main()
{
printf("Hello World!\n");
}

The first line is the the #include directive. C program uses this directive to load external function library - stdio is c library which provides standard input/output. printf is a function which is declared in the header file called stdio.h

The next is the main function - the first entry point of all C programs. C program logic starts from the beginning of main function to the its ending.

And finally is the printf function which accepts a string parameter. The printf function is used to print out the message to the screen.

Comments

Popular posts from this blog

NICOSIA