title: C program to print numbers between 100 and 1000 which sum of digit is 20
body: <p>I am writing a C program which should display me all numbers between 100 and 1000 which sum of digit is 20. I tried this code down here, but it just displays 0 as an ouput when I compile it, can you help me? I also tried moving if(iVsota==20) outside of the while loop. I am using Orwell Dev C++ IDE.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main (void)
  {
      int iVnos=0;
      int iOstanek=0;
      int iVsota=1;
      int iStevec1=100;
  
      for(iStevec1=100; iStevec1&lt;1000; iStevec1++)
      {
          while(iStevec1&gt;0)
          {
              iOstanek=iStevec1%100;
              iStevec1=iStevec1/10;
              iVsota=iOstanek+iVsota;
              if(iVsota==20)
              {
                  printf("%i\n", iStevec1);
              }
          }
      }
      return(0);
  </code></pre>
  
  <p>I hope this is better.</p>