File:  [CSRG BSD Unix] / 43BSDReno / usr.bin / learn / learnlib / C / L5.1b
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:56 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD43reno
BSD 4.3reno

#print
(Section 1.5)
Write a program that will read the first character
from its input and print it out in octal.
Compile it, test it, and then type ready.
#once #create Ref
+
#user
a.out <Ref >test
grep 53 test >/dev/null
#succeed
A possible solution:

main()
{
	printf("%o\n", getchar());
}

	Remember that you can use a function value almost
	any place that you could use a variable like x.
	Thus many times there's no need for extra variables.
#log
#next
5.1c 10
5.2b 5

unix.superglobalmegacorp.com

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