Draw a box on the screen using asterisks using for loop - C Statement

C examples for Statement:for

Description

Draw a box on the screen using asterisks using for loop

Demo Code

#include <stdio.h>

int main(void){
  printf("\n**************");         // Draw the top of the box
  for(int count = 1 ; count <= 8 ; ++count)
    printf("\n*            *");       // Draw the sides of the box
  printf("\n**************\n");       // Draw the bottom of the box
  return 0;//from   ww  w  .j a v  a2  s  .  co  m
}

Result


Related Tutorials