GATE | GATE-CS-2014-(Set-2) | Question 50
Consider the following function
Give a value q (to 2 decimals) such that f(q) will return q:_____.
This solution is contributed by Anil Saikrishna Devarasetty
The main thing to note is the expression “abs(x*x – 3) < 0.01″ inside the if condition. The function would return x when x2 is close to 0 (smaller than 0.01) which means when x is close to square root of 3. Square root of 3 is 1.732.–>
Quiz of this Question
Attention reader! Don’t stop learning now. Practice GATE exam well before the actual exam with the subject-wise and overall quizzes available in GATE Test Series Course.
Learn all GATE CS concepts with Free Live Classes on our youtube channel.