online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <iostream> using namespace std; int main() { int data[] = {32, 30, 12, 60, 50, 5, 90, 9}; int data_size = sizeof(data)/sizeof(int); // ENTER SUB-SEQUENCE int limit{0}; cout << "Enter how many numbers to check in sequence? "; cin >> limit; int* sub_array = new int[limit]; cout <<"What elements do you want to find in the array? "; for(int i = 0; i < limit; i++) { cin >> sub_array[i]; } // FIND FIRST ELEMENT int index{0}; while (index < data_size && data[index] != sub_array[0] ) { index++; } // CHECK REMAINDER OF SUB-SEQUENCE if(index < data_size) { cout << "Matching elements found as follows: " << data[index] << ' '; for(int i = 1; i < limit; i++) { for(int j = index; j < data_size; j++) { if(sub_array[i] == data[j]) { cout << data[j] << ' '; } } } } cout << '\n'; delete[] sub_array; 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