All
i
n
o
n
e
k
i
t
C++ Compiler
EXPLORER
main.cpp
main.cpp
Download ZIP
Compile & Run
#include <iostream> #include <vector> #include <string> using namespace std; // Function to demonstrate basic C++ features void greetUser(const string& name) { cout << "Hello, " << name << "! Welcome to the C++ Compiler!" << endl; } // Function to demonstrate STL usage void demonstrateSTL() { vector<int> numbers = {1, 2, 3, 4, 5}; cout << "Original numbers: "; for (int num : numbers) { cout << num << " "; } cout << endl; // Transform vector for (int& num : numbers) { num *= 2; } cout << "Doubled numbers: "; for (int num : numbers) { cout << num << " "; } cout << endl; } // Recursive function example int factorial(int n) { if (n <= 1) return 1; return n * factorial(n - 1); } int main() { cout << "=== C++ Compiler Demo ===" << endl; greetUser("Developer"); demonstrateSTL(); cout << "Factorial of 5: " << factorial(5) << endl; // Object-oriented example string language = "C++"; cout << "Programming in: " << language << endl; return 0; }
Console Output
Compile and run C++ code to see output here...