C Source File Structure - C Language Basics

C examples for Language Basics:Hello World

Introduction

The first thing to add to the source file is the main function.

main function is the entry point of the program.

The brackets, along with their content, is referred to as a code block.

int main(void) {}

#include directive replaces the line with everything in the specified header before the file is compiled.

The main function return statement returns a status code as the program exits.

Demo Code

#include <stdio.h>

int main(void) {
  printf("Hello World");
  return 0;/*w w  w . ja  v  a 2s . c  o  m*/
}

Related Tutorials