You are on page 1of 1

Laboratory work # 2

1. The real numbers x and y (x!=y) are given . Replace the lesser of these numbers by the half-sum
of the numbers, and the greater by the doubled product.

2. A real number a is given. Calculate f(a) if

f(x)=¿ {0 при x≤0,¿ {x −x при 0<x≤1, ¿ ¿¿¿


2
3. If the sum of 3 real numbers x,y,z <1, then replace the smallest of these numbers with the half-sum of
the other two, otherwise replace the smaller of x and y with the half-sum of the remaining two values.

4. The real numbers a, b, c are given. Find the roots of the quadratic equation ax2+bx+c=0, otherwise
the answer should be the message that there are no roots.

5. The real numbers x, y, z are given. Find out if there is a triangle with lengths of sides x, y, z.

6. Given three real numbers. Squared those of them whose values are non-negative.

7. Given real numbers. Choose those that belong to the interval [1,3].

8. The program asks the user "Сколько вам лет?". You enter a positive number up to 100. The
program must give the complete answer "Вам X (or год or года or лет).

9. Given the real numbers a, b, c. Double these numbers if a≥b≥c, and replace them with absolute
values if not.

10. A natural number n (n9999) is given. Is this number a palindrome (inverted) given four digits,
like , e.g., the numbers 2222, 6116, 0440, etc.

You might also like