Annotation of 43BSDTahoe/usr.lib/learn/C/L5.2a, revision 1.1

1.1     ! root        1: #print
        !             2: Write a program which reads a character from its
        !             3: input and prints "high" if that character is
        !             4: larger than 100 in numeric value (decimal) and "low"
        !             5: if it is less than or equal to 100 in numeric value.
        !             6: Compile it as usual and then type "ready".
        !             7: #once #create Ref1
        !             8: u is a big letter
        !             9: #once #create Ref2
        !            10: B is a small letter
        !            11: #user
        !            12: a.out <Ref1 >test1
        !            13: a.out <Ref2 >test2
        !            14: grep high test1 >/dev/null || grep low test2 >/dev/null 
        !            15: #succeed
        !            16: One way:
        !            17: 
        !            18: main()
        !            19: {
        !            20:        if (getchar() > 100)
        !            21:                printf("high\n");
        !            22:        else
        !            23:                printf("low\n");
        !            24: }
        !            25: #log
        !            26: #next
        !            27: 5.1b 10

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.