I wrote a function equlibrium which takes two input a (double) and i(int). Returns the output fEq. As per the code, function should print the value of fEq on screen when invoked from main body. But i didn't get output on screen . Is the function really invoked?. Or is there datatype error in calling with argument? Please help me. 

```
  #include <stdio.h>
  #include <stdlib.h>
  #include <math.h>
  #include <time.h>
  #include <sys/stat.h>
  #include <string.h>
  #include <dirent.h>

  // define global variables

  double w[3]= {2.0/3.0, 1.0/6.0, 1.0/6.0};
  int nx=100;
  int x, i;
  double u[100],u0[100];
  double fn[100][3];
  double fEq,a;

 //define function prototypes

 equlibrium (double a,int i, double fEq);

 // main program

 int main(int argc, char **argv)
 {
    u[0]  = 1.0e0;
    u[nx] = 1.0e0;   
    i=0;
    a = u[x];
    equlibrium (a, i, fEq);
 }

 //function equlibrium

 equlibrium (double a,int i, double fEq) 
 {
    if(i=0)
    {
       fEq = (w[0]-1.0) * a;
       printf("%lf\n", fEq);
    }
    else if(i=1)
    {
       fEq = (w[1] * a);
    }
    else
    {
       fEq = (w[2] * a);
    }
    return fEq;
}

```