]> Pileus Git - ~andy/sfvlug/blob - c/src/fun.c
Add C notes.
[~andy/sfvlug] / c / src / fun.c
1 #include <stdio.h>
2
3 void hello_world(void)
4 {
5         printf("Hello, World!\n");
6 }
7
8 void hello_name(char *name)
9 {
10         printf("Hello, %s!\n", name);
11 }
12
13 void hello_hello(int n)
14 {
15         printf("Hello, World!\n");
16         if (n > 1)
17                 hello_hello(n - 1);
18 }
19
20 int main()
21 {
22         hello_world();
23         printf("\n");
24
25         hello_name("World");
26         hello_name("Andy");
27         printf("\n");
28
29         hello_hello(10);
30         return 0;
31 }