First program
- processor instruction
- main function
//preprocessor directive, include header file stdio.h
#include <stdio.h>
//main function, always the first function called
int main(void)
{
printf("Hello, world!");
return 0;
}
Multiple functions
#include <stdio.h>
void sayHello(void);/* ISO/ANSI c function prototyping*/
void syaBye(void);
int main(void)
{
sayHello();
sayBye();
return 0;
}
void sayHello(void)
{
printf("Hello!\n");
}
void sayBye(void)
{
printf("Good bye!\n");
}