Skip to content

printf() ​

  • Example Print "Hello, World"
  • printf is the function to print output on the console.
  • The ; is treat as the end of the code (per function) as . end of the sentences.
c
#include <stdio.h>

int main() {
	printf("Hello, World!\n");
	return 0;
}

return ​

  • Use when the code is end.
  • the return value of 0 means the code run without any error.
  • if the return value is 1 or other value that means that the code is exit WITH error.

What is #include <stdio.h> ​

  • In this part is called pre-process.
  • That means it import the things we need for this code/project
  • For example, printf() is come from the <stdio.h>
  • <stdio.h> means standard input and output.
  • .h is header documents of c.

What is main/entry function ​

  • Example: The place we achieve our logic
  • It run the logic line by line.
  • and the main() is the entry function of C, It's required for a c programme.

INFO

While int main() means the data type returned by the function of main().

c
int main() {
	printf("Hello, World!\n");
	return 0;
}

A complete procedure of HelloWorld.c ​

Procedure of hello world c