Start development on BSD 4
[unix-history] / .ref-5cb41021d721f4e0ac572d592613f963e495d1ff / .ref-BSD-3 / usr / lib / learn / C / L1.1b
CommitLineData
fd15fd37
BJ
1#print
2(Section 1.1)
3Now write a C program that prints two lines,
4the first of which says "hello" and the second
5"goodbye". Don't forget those \n delimiters.
6Compile and test it. When satisfied,
7type "ready".
8#once #create Ref
9hello
10goodbye
11#user
12a.out >test
13#cmp test Ref
14#succeed
15Here is one possible solution to compare against yours.
16
17main()
18{
19 printf("hello\n");
20 printf("goodbye\n");
21}
22
23You could also combine the two messages into one
24call to printf, like
25
26 printf("hello\ngoodbye\n");
27
28but this is harder to read at a glance.
29#log
30#next
311.1c 10