online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> #include <ctime> using namespace std; const int N = 1000; int main() { int n, i, j = 0, a[N], q; cin >> n; cout << endl << endl; srand(time(NULL)); for (i = 0; i < n; i++) a[i] = rand() % 10; for (i = 0; i < n; i++) { cout << a[i]; if ((i + 1) % 5 == 0) cout << " | "; } cout << endl << endl; for (q = 0; q < n - 4; q = q + 5) for (i = q + 1; i < q + 5; i++) for (j = i; j > q && a[j - 1 + q] > a[j + q]; j--) swap(a[j - 1 + q], a[j + q]); for (i = 0; i < n; i++) { cout << a[i]; if ((i+1) % 5 == 0) cout << " | "; } cout << endl << endl; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue