xref: /original-bsd/usr.bin/pascal/pdx/test/case.p (revision c3e32dec)
1(*
2 * Copyright (c) 1980, 1993
3 *	The Regents of the University of California.  All rights reserved.
4 *
5 * %sccs.include.redist.c%
6 *
7 *	@(#)case.p	8.1 (Berkeley) 06/06/93
8 *)
9
10program casetest(input, output);
11var c : char;
12	s : 0..1000;
13	i : integer;
14begin
15	c := 'a';
16	case c of
17		'b': writeln('b');
18		'c': writeln('c');
19		'a': writeln('a');
20	end;
21	s := 3;
22	case s of
23		5: writeln('5');
24		3: writeln('3');
25		7: writeln('7');
26	end;
27	i := 1001;
28	case i of
29		0: writeln('0');
30		-1: writeln('-1');
31		1001: writeln('1001');
32		-1001: writeln('-1001');
33	end;
34end.
35