#include <iostream>
#include<cmath>
#include<ctime>
#include<string>
#include <iomanip>
#include <fstream>
using namespace std;
int main()
{
int count = 0;
// iterate from 0 to N
for (int num = 300,count = 0; num <=400; num++)
{
// Short-circuit operator is used
if (num % 3 == 0 || num % 6 == 0)
{
cout << setw(5) << num;
count++;
if (count % 5 == 0)
cout << setw(5) << num << endl;
}
}
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter