How will you check whether a number is a ugly number or not.
If a number has only factors are \( 2 \), \( 3 \) or \( 5 \), it is an ugly number. We can check by continuously dividing it with \( 2 \), \( 3 \) and \( 5 \). If the number finally becomes \( 1 \) after divison, it is an ugly number, otherwise not. |