Before we start the basics of the C programming language, we need to learn how to write, compile and run the c first program.
#include
int main() {
/* first program in C */
printf("Hello, World! \n");
return 0;
}
Let us take a look at the various parts of the above program −
- The first line of the program #include is a preprocessor command, which tells a C compiler to include stdio.h file before going to actual compilation.
- int main() The main() function is the entry point of every program in c language.
- The next line printf(...) is another function available in C which causes the message "Hello, World!" to be displayed on the screen.
- return 0 The return 0 statement, returns execution status to the OS. The 0 value is used for successful execution and 1 for unsuccessful execution.