AMCAT Automata Fix Sample Question-4

Program 4

Ugly Number

You need to fix the code syntactically and if there are any logical errors fix them too.

Statement : An ugly number is a positive integer whose prime factors are limited to 2, 3, and 5.

Given an integer n, return true if n is an ugly number.