title: How to Understand Code on zyBooks Ch. 4 Program: Drawing a half arrow
body: <p>This program outputs a downwards facing arrow composed of a rectangle and a right triangle. The arrow dimensions are defined by user specified arrow base height, arrow base width, and arrow head width.</p>
  
  <p>(1) Modify the given program to use a loop to output an arrow base of height arrowBaseHeight. (1 pt)</p>
  
  <p>(2) Modify the given program to use a loop to output an arrow base of width arrowBaseWidth. Use a nested loop in which the inner loop draws the *’s, and the outer loop iterates a number of times equal to the height of the arrow base. (1 pt)</p>
  
  <p>(3) Modify the given program to use a loop to output an arrow head of width arrowHeadWidth. Use a nested loop in which the inner loop draws the *’s, and the outer loop iterates a number of times equal to the height of the arrow head. (2 pts)</p>
  
  <p>(4) Modify the given program to only accept an arrow head width that is larger than the arrow base width. Use a loop to continue prompting the user for an arrow head width until the value is larger than the arrow base width. (1 pt)</p>
  
  <p>These are what it is wanting to me to do i just dont understand here is the code it starts with</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main(void) {
      int arrowBaseHeight;
      int arrowBaseWidth;
      int arrowHeadWidth;
  
      printf("Enter arrow base height:\n");
      scanf("%d", &amp;arrowBaseHeight);
  
      printf("Enter arrow base width:\n");
      scanf("%d", &amp;arrowBaseWidth);
  
      printf("Enter arrow head width:\n");
      scanf("%d", &amp;arrowHeadWidth);
      printf("\n");
  
      // Draw arrow base (height = 3, width = 2)
      printf( "**\n");
      printf( "**\n");
      printf( "**\n");
  
      // Draw arrow head (width = 4)
      printf( "****\n");
      printf( "***\n");
      printf( "**\n");
      printf( "*\n");
  
      return 0;
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/dmVL2.png" rel="nofollow noreferrer">What Zybooks wants it too look like minus the blue</a></p>