Find out the ugly prime number Desc: The given number is ugly prime number if it's prime factor contains only among 2,3 or 5. e.g. 20= 2*2*5 is ugly prime number 14=2*7 is not a ugly prime number So write a C function which takes values from 1 to n and returns the number of ugly primes number in it. input: 20 output: 3
Answers
Answered by
1
Answer:
Explanation:
Ugly numbers are those number whose prime factors are 2, 3 or 5. From 1 to 15, there are 11 ugly numbers 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15. The numbers 7, 11, 13 are not ugly because they are prime. The number 14 is not ugly because in its prime factor the 7 will come
Similar questions