title: Linear equation of two vaariable
body: <p>I want to find the solutions of linear equation of two variable(i know that there are infinitly many solution but i have to print some of them!)</p>
  <p>so i tried in <strong>C</strong> language
  what i have did is simply taken the input of coefficient of X,Y and c. Then calucalted the values as you can see it in the code Then calculated that if the result is satisfying the equation(means it is =0 or not) then checked and print.  After that i have incremented the value of x,y so that it can be calculaed with different numbers(in the first i have put it by default 0)..</p>
  <p>here is the code please see the code and tell me what is problem and am i doing mistake to choose the type of variable etc..
  if possible please give me the correct code(request).</p>
  <p>code in <strong>C</strong>:-</p>
  <pre class="lang-c prettyprint-override"><code>#include &lt;stdio.h&gt;
  
  int main()
  {
      float a, b, c, Rx, Ry;
      int sol;
  
      float x, y;
      printf(&quot;The Linear equation in two variable\n&quot;);
      printf(&quot;Formate is   aX+bY+c=0\n&quot;);
      printf(&quot;Enter the coefficient of 'X'\n&quot;);
      scanf(&quot;%f&quot;, &amp;a);
      printf(&quot;Enter the coefficient of 'Y'\n&quot;);
      scanf(&quot;%f&quot;, &amp;b);
      printf(&quot;Enter the coefficient of constant 'c'\n&quot;);
      scanf(&quot;%f&quot;, &amp;c);
  
      printf(&quot;Your equation looks like\n&quot;);
      printf(&quot;%0.0fX+%0.0fY+%0.0f=0\n&quot;, a, b, c);
  
      x = 0;
      y = 0;
      for (int i = 0; i &lt; 10; i++)
      {
          //  for x
  
          x = ((-c) + (-b * y)) / b;
          printf(&quot;The value of x is %0.2f\n&quot;, x);
  
          // for y
  
          y = ((-c) + (-a * x)) / a;
          printf(&quot;The value of y is %0.2f\n&quot;, y);
  
          // checking wheter the value of x and y satisfy the equation (which is equal to 0)
          sol = (a * x) + (b * y) + (c);
          printf(&quot;The value of sol is %0.2f\n&quot;, sol);
  
          x++;
          y++;
          if (sol == 0)
          {
              printf(&quot;The value of x at %d time is %0.2f\n&quot;, i, x);
              printf(&quot;The value of y at %d time is %0.2f\n&quot;, i, y);
          }
          else
              continue;
      }
  
      return 0;
  }
  </code></pre>