File:  [CSRG BSD Unix] / 43BSDTahoe / usr.lib / learn / C / L1.1d
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:58 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD43tahoe
BSD 4.3tahoe

#print
(Section 1.1)
Write a program which prints these four lines,
exactly as shown:
A tab is \t
A backspace is \b
A quote is \"
A backslash is \\

Compile it, test it, then type ready.
#once #create Ref
A tab is \t
A backspace is \b
A quote is \"
A backslash is \\
#user
a.out >x
#cmp x Ref
#succeed
One solution:

main()
{
	printf("A tab is \\t\n");
	printf("A backspace is \\b\n");
	printf("A quote is \\\"\n");
	printf("A backslash is \\\\\n");
}
#fail
Watch out for those backslashes.
#log
#next
1.1e 10

unix.superglobalmegacorp.com

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