fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int main()
  5. {
  6. int n = 100;
  7. for(int i=2; i<n; i++){
  8. if(i%2==0){
  9. cout<<i<<", ";
  10. }else if(i%3==0){
  11. cout<<i<<", ";
  12. }else if(i%5==0){
  13. cout<<i<<", ";
  14. }
  15. }
  16. }
Success #stdin #stdout 0.02s 2724KB
stdin
Standard input is empty
stdout
2, 3, 4, 5, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 22, 24, 25, 26, 27, 28, 30, 32, 33, 34, 35, 36, 38, 39, 40, 42, 44, 45, 46, 48, 50, 51, 52, 54, 55, 56, 57, 58, 60, 62, 63, 64, 65, 66, 68, 69, 70, 72, 74, 75, 76, 78, 80, 81, 82, 84, 85, 86, 87, 88, 90, 92, 93, 94, 95, 96, 98, 99,