
'begin'
	'comment'
		This is a simple example for the 
		``Jensen device''
	;

	'procedure' jdev ( i, n, s, x ) ;
	'begin'
		s := 0;
		'for' i := 1 'step' 1 'until' n 'do'
			s := s + x;
	'end';

	'integer' NN;

	NN := 100;

	'begin'

		'integer' i;
		'real' sum, t1sum, t2sum;
		'integer' 'array' arr [1:NN];

		t1sum := t2sum := 0;
		'for' i:=1 'step' 1 'until' NN 'do'
		'begin'
			arr[i] := i;
			t1sum := t1sum + i;
			t2sum := t2sum + 1 / i
		'end';

		jdev (i, NN, sum, arr[i]);

		outstring (1, `#1: ');
		outreal (1, t1sum);
		outreal (1, sum);
		outstring (1, `\n');

		jdev (i, NN, sum, 1 / arr[i]);

		outstring (1, `#2: ');
		outreal (1, t2sum);
		outreal (1, sum);
		outstring (1, `\n')
	'end';
'end'
