title: Declared variable not showing up in Locals of Debugger
body: <p>This is a simple program to calculate the length of lines. All the calculation aspects of the program are done and working.
  But I am having trouble on one very simple aspect, the variable "percent_detoured" is declared on line 10 and used on line 83, and printed on line 84. Problem is when executed, everything else runs fine but percent_detoured consistently returns 0.000. When debugged, percent_detoured does not even show as a variable in "Locals". 
  I am using Pelles C IDE if that helps.</p>
  
  <p>Thanks for the help! </p>
  
  <pre><code>{
  float line_value;       
  int x_1, y_1, x_2, y_2;         
  float y_intercept;      
  float distance, greatest_distance, total;
  float percent_detoured;             // &lt;-- DECLARED HERE (SCROLL ALL THE WAY DOWN TO SEE WHERE IT IS USED)
  int count, detour_count;        
  
  x_1=1; y_1=1; x_2=1; y_2=1;     
  greatest_distance = 0;  total = 0;  count = 0;  detour_count = 0; 
  
  /* Ask for user input in setting the coordinates of the line */
  printf("Enter in the length of the line\n");
  scanf("%f", &amp;line_value);
  
  
  /* If user enters in y coordinates for the line such that the line length is greater
      than 10 units, then enter loop and continue looping until the length is smaller or 
      equal to 10 */
  while ( line_value &gt; 10 || line_value &lt; 0)
  {
      printf("Try Again. Value should be smaller or equal to 10 units\n");
      scanf("%f", &amp;line_value);
  }
  
  line_value = line_value / 2;            //Define the top of the line
  
  printf("Enter x and y coordinates for point 1 and 2\n");
  scanf("%d %d %d %d", &amp;x_1, &amp;y_1, &amp;x_2, &amp;y_2);
  
  if ( x_1 == 0 &amp;&amp; x_2 == 0 &amp;&amp; y_1 == 0 &amp;&amp; y_2 == 0 )     //If user enters in 0 0 0 0 right away, then immediately end the program
  {
      printf("No path lengths have been calculated\n");
  }
  
  else        
  {
      /* While the user does not enter in the values 0 0 0 0 for all coordinates, continue while loop */
      while ( (x_1 != 0) || (y_1 != 0) || (x_2 != 0) || (y_2 != 0) )
      {
          y_intercept = y_1 - ( (y_2 - y_1) / (x_2 - x_1) * x_1 );    //Rearrange (y=mx+b) to get (b=y-mx) where b is the y intercept
  
          if ( y_intercept &lt;= line_value &amp;&amp; y_intercept &gt;= 0 )    //If the y-intercept of the line from point a to b is between
          {                                                           //the top of L and 0, then calculate distance between a and top of L
              distance = sqrt( pow(x_1, 2) + pow((y_1 - line_value), 2) )
                          + sqrt( pow(x_2, 2) + pow((line_value - y_2), 2) );
              detour_count++;                 //Updating the detour counter
          }
          else if ( y_intercept &gt;= ( line_value * -1) &amp;&amp; y_intercept &lt; 0 )    //If the y-intercept of the line from point a to b is between 
          {                                                                   //the bottom of L and 0, then calculate distance between a and bottom of L
              distance = sqrt( pow(x_1, 2) + pow( (y_1 + line_value), 2) )
                          + sqrt( pow(x_2, 2) + pow(( y_2 - (line_value * -1) ), 2) );
              detour_count++;                 //Updating the detour counter
          }
          else 
          {
              distance = sqrt( pow((x_2 - x_1), 2) + pow((y_2 - y_1), 2));    //If shortest path between point a and b does not cross L,
          }                                                                   //then the distance is just the sum of squares of rise and run
  
          if (distance &gt; greatest_distance)
          {
              greatest_distance = distance;   //If the current distance is greater than the previous, set it as the greatest distance
          }
  
          total = total + distance;       //Total count of distance
          count++;                        //Update general counter
  
          printf("The shortest path is: %f\n", distance);
  
          printf("Enter x and y coordinates for point 1 and 2\n");
          scanf("%d %d %d %d", &amp;x_1, &amp;y_1, &amp;x_2, &amp;y_2);
      }
  
  }
  
  printf("\nThe average path length: %f\n", (total/count));       
  printf("The length of the longest path: %f\n", greatest_distance);
  
  percent_detoured = ((detour_count/count) * 100);        // &lt;-- USED IT HERE
  printf("The percentage of paths involving a detour: %f\n", percent_detoured );    // &lt;-- SHOULD BE PRINTED AS ITS VALUE HERE
  
  return 0;
  </code></pre>
  
  <p>}</p>