online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include<stdio.h> void fun(int *a,int n,int S){ int i = n-2, j = n-1; while (j > 0){ if (a[j] - a[i] < S) i--; else if (a[j] - a[i] == S) break; else j--; } if (j != 0) printf("yes\n") ; else printf ("no\n"); } int main() { int arr[]={2,3,7,9}; fun(arr,4,3); fun(arr,4,5); fun(arr,4,8); fun(arr,4,6); }

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