MeetCode
Compare Fractions a/b and c/d
C
C++
Computer Mathematics
CSS
DSA
HTML
Java
JavaScript
NodeJS
PHP
Programming Interview
Python
ReactJS
SQL
Run
Submit
Dark
Problem Statement
Solutions
Submissions
Compare Fractions a/b and c/d
Hard
Computer Mathematics
Integers & Divisibility
37 views
Explanation
Complexity
Problem Statement
Compare two fractions without floating point. Print , or =.
Input Format
Four integers a b c d.
Output Format
One char: < or > or =.
Example
Input
1 3 2 6
Output
=
Constraints
b,d != 0, values fit in 64-bit
Input / Output Format
Input Format
Four integers a b c d.
Output Format
One char: < or > or =.
Constraints
b,d != 0, values fit in 64-bit
Examples
Input:
1 3 2 6
Output:
=
Example Solution (Public)
Computer Mathematics
Compare a*d and c*b using integer multiplication. If a*d < c*b print < etc.
Official Solution Code
Wrap
Copy
Compare a*d and c*b using integer multiplication. If a*d < c*b print < etc.
Please
login
to submit solutions.
Editor
C
C++
Computer Mathematics
CSS
DSA
HTML
Java
JavaScript
NodeJS
PHP
Programming Interview
Python
ReactJS
SQL
Test Cases
Output
Submission Result
Input
1 3 2 6
Expected Output
=
Compile Output
Error
Output
Please
login
to submit solutions.