printf()
- Example Print "Hello, World"
printfis 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
0means the code run without any error. - if the return value is
1or other value that means that the code is exitWITHerror.
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..his 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 ofC, 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
