Logo  

CS256 - Fundamentals of Structured Programming

Displaying ./code/loops/while.c

#include <stdio.h>

void line(int width)
{
  int i=0;
  while (i < width) {
    putchar('#');
    i++;
  }
  putchar('\n');
}


int main(void)
{
  int i = 0;

  while(i < 10) {
    line(10);
    i++;
  }
  
  return 0;
}