online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <iostream> #include <string> #include <vector> using namespace std; vector<string> fizzBuzz(int n) { vector<string> arreglo; for (int i = 1; i <= n; ++i) { string s = ""; if ((i % 3 != 0) and (i % 5 != 0)) s += to_string(i); else if (i % 3 == 0) s += "Fizz"; if (i % 5 == 0) s += "Buzz"; arreglo.push_back(s); } return arreglo; } int main() { cout << "[ "; for (string elemento : fizzBuzz(5)) cout << "'" << elemento << "'" << " "; cout << "]" << 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