#include <iostream> using namespace std; int main() { int num[15]; cout << "{"; for(int i = 0; i < 15; i++) { if(i % 2 == 0) { num[i] = i * 2; } else { num[i] = i * 3; } cout << num[i] << ", "; } cout << "}"; }
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