Рубрики

ВОРОТА | GATE-CS-2015 (набор 2) | Вопрос 9

If p, q, r, s are distinct integers such that:
f(p, q, r, s) = max (p, q, r, s)
g(p, q, r, s) = min (p, q, r, s)
h(p, q, r, s) = remainder of (p × q) / (r × s)  if (p × q) > (r × s) OR 
                remainder of (r × s) / (p × q) if (r × s) > (p × q)
Also a function fgh (p, q, r, s) =
                f(p, q, r, s) × g(p, q, r, s) × h(p, q, r, s).
Also the same operation are valid with two variable functions 
of the form f(p, q).

What is the value of fg(h(2, 5, 7, 3), 4, 6, 8)? 

(А) 6
(Б) 7
(С) 8
(D) 9

Ответ: (с)
Объяснение:

The question asks value of fg (h(2, 5, 7, 3), 4, 6, 8)

We need to first find value of h(2, 5, 7, 3) 

h is defined as 
h(p, q, r, s) = remainder of (p × q) / (r × s)  if (p × q) > (r × s)
                remainder of (r × s) / (r × q)  if (r × s) > (p × q)

h(2, 5, 7, 3) = remainder of (7 * 3) / (2 * 5)  since 7*3 > 2*5
              = 1

fg(1, 4, 6, 8) = f(1, 4, 6, 8) * g(1, 4, 6, 8)
               = max(1, 4, 6, 8) * min(1, 4, 6, 8)
               = 8 * 1
               = 8

Тест на этот вопрос

Рекомендуемые посты:

ВОРОТА | GATE-CS-2015 (набор 2) | Вопрос 9

0.00 (0%) 0 votes