title: Function do not return proper value
body: <p>The function <code>converterm(met, bri);</code> when called is not returning proper values. The code is still incomplete but it works for some options. Just type-in the values and whenever asked which option to select, select option 1 and see the results.</p>
  
  <p>At this line <code>conm.m = conb.ft / 3.2808;</code> it do not return expected values.</p>
  
  <pre><code>//METRIC_BRITISH - BUILD 1.0
  
  #include&lt;stdio.h&gt;
  #include&lt;stdlib.h&gt;
  #include&lt;process.h&gt;
  
  //GLOBAL-STRUCTURES DECLARATION
  struct metric
  {
  float m;
  float cm;
  };
  
  struct british
  {
  float ft;
  float in;
  };
  
  //GLOBAL-STRUCTURE-VARIABLE DECLARATION
  struct metric met = { 0,0 };
  struct british bri = { 0,0 };
  int q = 0;
  int w = 0;
  
  //USER-DEFINED FUNCTION
  struct metric converterm(struct metric conm, struct british conb);
  struct british converterb(struct british conb, struct metric conm);
  void header();
  
  void header()
  {
  printf("*-*-*-*-*METRIC_BRITISH*-*-*-*-*");
  printf("\n\n");
  }
  
  //PROGRAM STARTS HERE
  main()
  {
  //VARIABLE-DECLARATION
  int n = 0, c = 0, b = 0, v = 0, i = 0;
  
  //FUNCTION CALL-OUT
  header();
  
  printf("Format : Metric \n\n");
  printf("Enter the Value for Metres : ");
  scanf_s("%f", &amp;met.m);
  printf("\n");
  printf("Enter the Value for Centimetres : ");
  scanf_s("%f", &amp;met.cm);
  printf("\n");
  
  printf("*--------------------------------------------*\n\n");
  
  printf("Format : British \n\n");
  printf("Enter the Value for Feet : ");
  scanf_s("%f", &amp;bri.ft);
  printf("\n");
  printf("Enter the Value for Inches : ");
  scanf_s("%f", &amp;bri.in);
  printf("\n\n");
  
  printf("In which Format would you like to add other value? \n");
  printf("1. Metric \n");
  printf("2. British \n");
  printf("Enter any Option : ");
  
  while (i == 0)
  {
      printf("\n");
      scanf_s("%d", &amp;n);
      switch (n)
      {
      case 1:
  
          printf("In which Unit you want to add value? \n");
          printf("1. Metres \n");
          printf("2. Centimetres \n");
          printf("Enter any Option : ");
          scanf_s("%d", &amp;c);
          q = c;
          met = converterm(met, bri);
          i = 1;
  
          break;
  
      case 2:
  
          printf("In which Unit you want to add value? \n");
          printf("1. Feet \n");
          printf("2. Inch \n");
          printf("Enter any Option : ");
          scanf_s("%d", &amp;c);
          q = c;
          bri = converterb(bri, met);
          i = 1;
  
          break;
  
      default:
  
          printf("INVALID OPTION. \n");
          printf("Please Enter Correct Option.");
          i = 0;
  
          break;
      }
  
  }
  
  printf("Values for Metric : \n");
  printf("Metres = %d \n", met.m);
  printf("Centimetre = %d \n", met.cm);
  
  printf("\n*--------------------------------------------*\n\n");
  
  printf("Values for British : \n");
  printf("Feet = %d \n", bri.ft);
  printf("Inch = %d \n", bri.in);
  
  //TERMINAL-PAUSE
  system("pause");
  }
  
  struct metric converterm(struct metric conm, struct british conb)
  {
  int i = 0;
  
  switch (q)
  {
  case 1:
  
      printf("\n");
      printf("Would you like to Add? \n");
      printf("1. Add Feet to Metre \n");
      printf("2. Add Inch to Metre \n");
      printf("Enter any Option : ");
      scanf_s("%d", &amp;i);
      break;
  
  case 2:
  
      printf("\n");
      printf("Would you like to Add? \n");
      printf("1. Add Feet to Centimetre \n");
      printf("2. Add Inch to Centimetre \n");
      printf("Enter any Option : ");
      scanf_s("%d", &amp;i);
      break;
  
  }
  
  if (i == 1)
  {
      conm.m = conb.ft / 3.2808;
      //conm.m = conb.in / 39.370;
  }
  
  else
  {
      conm.cm = conb.ft / 0.032808;
      //conm.cm = conb.in / 0.39370;
  }
  
  return(conm);
  }
  
  struct british converterb(struct british conb, struct metric conm)
  {
  int i = 0;
  
  switch (w)
  {
  case 1:
  
      printf("\n");
      printf("Would you like to Add? \n");
      printf("1. Add Metre to Feet \n");
      printf("2. Add Centimetre to Feet \n");
      printf("Enter any Option : ");
      scanf_s("%d", &amp;i);
      break;
  
  case 2:
  
      printf("\n");
      printf("Would you like to Add? \n");
      printf("1. Add Metre to Inch \n");
      printf("2. Add Centimetre to Inch \n");
      printf("Enter any Option : ");
      scanf_s("%d", &amp;i);
      break;
  
  }
  
  if (i == 1)
  {
      conb.ft = conm.m*3.2808;
      //conb.ft = conm.cm*0.032808;
  }
  
  else
  {
      conb.in = conm.m*39.370;
      //conb.in = conm.cm*0.39370;
  }
  
  return(conb);
  
  }
  </code></pre>