title: (Hackerrank - Fair Rations) When return a string following error appears(C#). error CS0029: Cannot implicitly convert type string' to int
body: <p><strong>error CS0029: Cannot implicitly convert type string' to int</strong></p>
  
  <p>I'm trying to solve HackerRank's <a href="https://www.hackerrank.com/challenges/fair-rations/problem" rel="nofollow noreferrer">Fair Rations</a>. I should return an Integer or string "NO". When I trying to return string "NO" the following error message appears</p>
  
  <pre><code>// Solution.cs(49,16): error CS0029: Cannot implicitly convert type `string' to `int'
  </code></pre>
  
  <p>Following is my code.</p>
  
  <pre><code>int temp = 0;
  string s = "N0";
  
  for(int i = 0; i &lt; B.Length - 1; i++)
  {  
     if(B[i] % 2 == 1)
     {
          B[i] = B[i] + 1;
          B[i + 1] = B[i + 1] + 1;
          temp += 2;
     }
  }
  
  for(int i = 0; i &lt; B.Length; i++)
  {
      if(B[i] % 2 == 1)
      {
          temp = 0;
      }
  }
  
  if(temp &gt; 0)
  {
      return temp;
  }
  else
  {
      return s;
  }
  </code></pre>
  
  <p>How I return "NO" ?. When I use `Console.WriteLine()' following error messege appears </p>
  
  <pre><code>//Solution.cs(18,16): error CS0161: `Solution.fairRations(int[])': not all code paths return a value
  </code></pre>