online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <iostream> #include <ctime> using namespace std; int main() { int tab[50]; srand(time(NULL)); cout << "Wygenerowae liczby: " << endl; for (int i=0; i<50; i++) { tab[i] = rand()%50 + 1; cout.width(3); ((i+1) % 10 == 0) ? cout << tab[i] << endl : cout << tab[i] << " "; } int licznik = 0; // To co podał @Idezam; cout << endl << "Liczby parzyste:" << endl; for (int i=0; i<50; i++) if (tab[i] % 2 == 0) { cout.width(3); ((licznik+1) % 10 == 0) ? cout << tab[i] << endl : cout << tab[i] << " "; licznik++; // To co podał @Idezam; } cout << endl << "Ilosc liczb parzystych: " << licznik << " [" << (((float)licznik / 50) * 100) << "%]" << endl; return 0; }

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