title: Assigning two values with an union variable
body: <p>The variable a is assigned by value 10 and the variable b is assigned by 20 with the union variable v. Then it gives the output of a is 20 instead of 10. I don't get it.  </p>
  
  <pre><code>#include&lt;stdio.h&gt;  
  int main()  
  {
     union var
     {
         int a, b;
     };
     union var v;
     v.a=10;
     v.b=20;
     printf("%d\n", v.a);
     return 0;
  }  
  </code></pre>
  
  <p>I executed the program and I got 20 as output. </p>