title: Returning value in C programming
body: <p>I have the following problem, where X=10, Y=85 and D=30 are already defined.</p>
  
  <pre><code>int solution (int X, int Y, int D) 
  {     
          //put your code here 
  }
  </code></pre>
  
  <p>I need to count the number till the value of X reaches to Y, when X is added to D, for example X = X+D</p>
  
  <p>I know the return value must be 3, this is what I have done,</p>
  
  <pre><code>    int count = 0;
      int solution (int X, int Y, int D)
      {
         if (X&lt;=Y)
         {
            count++;
            X = X+D;
         }
         else
        {
          return count;
        }
      }
  </code></pre>
  
  <p>But I am just a return value as 0, where am I doing it wrong?</p>