title: Why am i losing the value of variable n2?
body: <p>I am doing school work and I came across a problem. Why do I loose the value of the variable <code>n2</code>?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int opt;
  double n1;
  double n2;
  
  int main()
  {
      printf("Hello and welcome \n");
      printf("Lets do Some math! \n");
      printf("Menu!\n");
      printf("1- \t Areas \n");
      printf("2- \t Perimetros \n");
      scanf("%d",&amp;opt);
  
      switch (opt){
          case 1:
              Areas();
              break;
  
          case 2:
              break;
      }
      return 0;
  }
  
  void Areas(){
      printf("Area de:\n");
      printf("1- \t Quadrado\n");
      printf("2- \t Retangulo\n");
      printf("3- \t Losangulo\n");
      printf("1- \t Circulo\n");
      scanf("%d", &amp;opt);
  
      switch (opt){
          case 1:
              Medidas("dos lados.");
              printf("%d  %d\n", n1,n2 );
              break;
  
          case 2:
              break;
      }
  }
  
  void Medidas(char string[]){
      printf("Introduzir as Medidas %s \n", string);
      scanf("%d", &amp;n1);
      printf("Next\n");
      scanf("%d", &amp;n2);
  }
  </code></pre>
  
  <p>I tried many things and nothing works. The</p>
  
  <pre><code>    printf("%d  %d\n", n1,n2 );
  </code></pre>
  
  <p>is just for debugging purposes.</p>