Problem 2162. Let's get back to school: create mixed numbered fraction

A fractional number can be represented as mixed number.

A "mixed number" consists of an integer followed by a proper fraction and "proper fraction" is a fraction with the numerator smaller than the denominator.

e.g. if given fraction is, 1.33 then, it can be represented as 1 (1/3), meaning, (1*3+1)/3 = 4/3 = 1.33

The task is to convert the given fractional number into a mixed number and return the 3 digits as an array of length 3. For making it easy and to output unique solution, the integer should always be 1 and the remaining fraction need not be a "proper fraction". (so for input 1.33, output will be [1 1 3], for input 1.66, output will be [1 2 3] )

Solution Stats

35.82% Correct | 64.18% Incorrect
Last Solution submitted on Feb 13, 2024

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers23

Suggested Problems

More from this Author25

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!