I am not exactly sure what you are trying to compute, but I have tried to write a relatively clear C code of what you might have been trying to do above.
I have included certain "printf" statements for you to check few validations.
/******************************************************************************
Online C Compiler.
Code, Compile, Run and Debug C program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
#include <stdio.h>
#include <string.h>
int main()
{
printf("Hello World\n");
//num_str = input();
char num_str[30];
printf("Enter a string: ");
scanf("%s",num_str);
int n =0 ;
n = strlen(num_str);
printf("strlen: %d\n",n);
int i = 0;
int sum = 0;
int a;
while (i<n)
{
i=i+1;
a=(int)(num_str[i]);
}
int mean = sum / n;
printf("Mean value: %d",mean);
return 0;
}