## Tutorial 3

1. Write a Pascal program to show an output below

12 * 1 = 12

12 * 2= 24

.........

12 * 12 = 144

by using control structures, i.e., while...do, repeat...until, for...to...do

2. Write a Pascal program to find a summation of the following sequence

5 + 12 + 19 + ......+ 278

3. Write a Pascal program to verify an integer received from a keyboard. If the integer is in a range from -3 to 3, show the output corresponding to the received integer as the table below

 -3 GO -2 WENT -1 GONE 0 SEPARATE 1 DONE 2 DID 3 DO

4. Write a Pascal program that will receive 20 integer variables. Find the maximum and minimum values of this set of variables.

5. Write a Pascal program to find the summation of a sequence below

y = -(1/1^2) + (1/2^2) - (1/3^2) + (1/4^2) -.....
Hint: Use operator MOD to verify that n is odd or even number.

6. Write a Pascal program that has a function
q(a,b) = 0  , for a < b
= q(a-b,b)  , for a >= b
In your program, you must receive value a and b and send these values to your function. Check your result with the following example.
q(14,3) = 4
q(5861,7) = 837