online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <stdio.h> int digitCount(int a[], int n){ int count=0; for(int i=1;i<=n;i++){ int k=a[i]; while(k!=0){ count++; k=k/10; } } return count; } void display(int a[], int n){ for(int i=1;i<=n;i++) printf("%d ",a[i]); } int main() { int n; scanf("%d",&n); int a[n]; for(int i=1;i<=n;i++){ a[i]=i; } int result=digitCount(a,n); printf("%d\n",result); 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