#include<iostream>
#include<cstdlib>
#include<conio.h>
using namespace std;
int main()
{
int i,j=0;
cout<<"1";
for(i=1;i<=55;i++){
if(j>12)
break;
else{
if(i%2==0||i%3==0||i%5==0)
j++;
}
}
getch();
return 0;
}
This is my code .I want to print the numbers whose only prime factors are 2, 3 or 5. The sequence
1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, ... with a limit such as first 11 prime.
But this code does not compile after the 12th loop.Please help.