File:  [CSRG BSD Unix] / 43BSDTahoe / ucb / pascal / tstpx / src / t12.p
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

program records(output);
type
	cmplx = record
		rp: real;
		ip: real;
	end;
var
	x, y: cmplx;
function cadd(a,b: cmplx): cmplx;
	var result: cmplx;
	begin
		result.rp := a.rp + b.rp;
		result.ip := a.ip + b.ip;
		cadd := result;
	end;
procedure cprint(a: cmplx);
	begin
		writeln(a.rp, '+', a.ip, 'i');
	end;
begin
	x.rp := 1;
	x.ip := 2;
	y.rp := 3;
	y.ip := 4;
	cprint(cadd(x, y));
end.

unix.superglobalmegacorp.com

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