title: how to export integer value to the environment variable in c
body: <p>I have tried below program to export a value to the environment variable. I want to export an integer value to the environment variable. Below program is taking value as "a" instead of 1. How to export integer value to that environment variable. </p>
  
  <pre><code>#include&lt;stdio.h&gt;
  
  void chnge_env_var(int a)
  {
      char *name1="ENV_VAR";
      char *val=NULL;
      int status;
      status = putenv("ENV_VAR=a");
      printf("status %d\n",status);
      val = getenv(name1);
      printf("val %s\n",val);
  }
  
  int main()
  {
      int a=1;
      chnge_env_var(a);
  return 0;
  }
  </code></pre>