The GATE Grind

GATE 2015 CS (CS2) – Question 8

General Aptitude · Quantitative Aptitude: Data Interpretation, Arithmetic and Number Computation · 2 marks · Numerical answer

For distinct integers p,q,r,s, f(p,q,r,s)=max(p,q,r,s), g(p,q,r,s)=min(p,q,r,s), and h(p,q,r,s) is the remainder when the larger of pq and rs is divided by the smaller. Products of function names denote products of values, for example fgh=f×g×h; the operations also apply to two arguments. Find fg(h(2,5,7,3),4,6,8).

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: 8

Explanation

First pq=10 and rs=21, so h(2,5,7,3)=21 mod 10=1. The outer inputs are one,four,six,eight. Their maximum is eight and minimum one, so fg is 8×1=8. The requested expression is fg, not fgh; therefore no outer remainder is multiplied in.

More Quantitative Aptitude: Data Interpretation, Arithmetic and Number Computation questions

All Quantitative Aptitude: Data Interpretation, Arithmetic and Number Computation questions →