can some one help me with this problem? i dont know what i need to program?
Funny numbers are numbers whose only prime factors are 2, 3 or 5. The sequence
1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, ...
shows the first 11 funny numbers. By convention, 1 is included.
Write a program to find and print the 1501'st funny/ugly number.
Just use the modulus operator. Here is a quick example:
1 2 3 4 5 6 7 8 9 10 11 12 13
//Using the % operator to find if a number is divisible by another number.
int x = 1, y = 11, z = 17; //We are going to find out what numbers divide by y and/or z.
for(x = 1; x < 500; ++x)
{
if(x % y == 0)
{
std::cout << y << " is a factor of x\n";
}
if(x % z == 0)
{
std::cout << z << "is a factor of x\n";
}
}