Comparing fractions

Write a function

    bool c_frac(int n1, int d1, int n2, int d2);

that returns true whenever the fraction n1d1\frac{n1}{d1} is strictly smaller than the fraction n2d2\frac{n2}{d2}.

Precondition

@d1@, @d2@ >0> 0.

Observation

You only need to submit the required procedure; your main program will be ignored.

Problem information

Author: Unknown
Translator: Maria Serna

Generation: 2026-01-25T13:22:04.981Z

© Jutge.org, 2006–2026.
https://jutge.org