online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> #include <vector> int main() { int n = 0; //ask user how many input he/she wants to give std::cout << "How many elements do you want to enter: "; std::cin >> n; std::vector<int> vec(n); //create a vector of size n int resultOfSubtraction = 0; //take input from user for(int i = 0 ; i < n ; ++i) { std::cin >> vec.at(i); if(i != 0) { resultOfSubtraction-= vec.at(i); } else { resultOfSubtraction = vec.at(i); } } std::cout<<"result is: "<<resultOfSubtraction<<std::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