online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
//Linear Search #include <stdio.h> int linear_search(int a[10], int n, int key); int main() { int a[10], key, n, pos; printf("INPUT NUMBER OF ELEMENT IN ARRAY:"); scanf("%d", &n); printf("ENTER %d NUMBERS:\n", n); for(int i=0; i<n; i++) scanf("%d", &a[i]); printf("ENTER NUMBER TO SEARCH:\n"); scanf("%d", &key); pos=linear_search(a, n, key); if(pos == -1) printf("%d IS NOT PRESENT IN ARRAY!!\n", key); else printf("%d IS PRESENT IN ARRAY\n", key); return 0; } int linear_search(int a[10], int n, int key) { int i; for(i=0; i<n; i++) { if(a[i]==key) return 1; } return -1; }

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