title: A right angle triangle of that symbol with sides equal to that number
body: <p>The program I'm working on outputs a right triangle of that symbol with sides equal to that number. What it should do is terminate if you enter 0 otherwise it should ask for a new input again.</p>
  
  <p>So my question is how can I make it terminate if you enter 0, otherwise ask for another input? I know I probably need to use while loop. But how do I change it? </p>
  
  <p>Here is my code: </p>
  
  <pre><code>#include &lt;assert.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main()
  {
      char s;         /*s is symbol (the input)*/
      int a, b, n;    /*n is number of rows (the input)*/
  
      printf("Please type the symbol of the triangle:...\n"); /*Ask for symbol input*/
      scanf_s("%c", &amp;s, 1);
      printf("Please type a positive non-zero number between 5 and 35:...\n"); /*Ask for number of rows input*/
      scanf_s("%d", &amp;n);
      assert(n &gt;= 5 &amp;&amp; n &lt;= 35);
  
      for (a = 1; a &lt;= n; a++) /*How many rows to display+create*/
      {
          for (b = 1; b &lt;= a; b++)
          {
              printf("%c", s);
          }
          printf("\n");
      }
      system("PAUSE");
  }
  </code></pre>