Start development on BSD 4
[unix-history] / .ref-5cb41021d721f4e0ac572d592613f963e495d1ff / .ref-BSD-3 / usr / lib / learn / C / L5.2a
CommitLineData
fd15fd37
BJ
1#print
2Write a program which reads a character from its
3input and prints "high" if that character is
4larger than 100 in numeric value (decimal) and "low"
5if it is less than or equal to 100 in numeric value.
6Compile it as usual and then type "ready".
7#once #create Ref1
8u is a big letter
9#once #create Ref2
10B is a small letter
11#user
12a.out <Ref1 >test1
13a.out <Ref2 >test2
14grep high test1 >/dev/null && grep low test2 >/dev/null
15#succeed
16One way:
17
18main()
19{
20 if (getchar() > 100)
21 printf("high\n");
22 else
23 printf("low\n");
24}
25#log
26#next
275.1b 10