Logo  

CS256 - Fundamentals of Structured Programming

Displaying exercises/e6/files/p4.c

#include <stdio.h>

/**
 * Complete this function.  It should use a loop to output length number of
 * hash marks.  Then output a newline after the loop.
 */
void line(int length)
{

}

/**
 * Complete the main function such that it prompts for a height and then prints
 * numbers 1 through the input height (right aligned to 2 columns) followed by
 * a colon (:) and a space, then call the above function to print that same
 * number of hash marks.
 * Example input/output:
 * ./p4 
 * Height: 5
 *  1: #
 *  2: ##
 *  3: ###
 *  4: ####
 *  5: #####
 */
int main(void)
{

  return 0;
}