OCJP

Design of Rectangle with diagonals

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
clrscr();
for(i=1;i<=10;i++)
{
      for(j=1;j<=10;j++)
      {
      if(i==1 || i==10 || j==1 || j==10 || (i+j)==11 || i==j)
      {
      printf(" # ");
      }
      else
      {
      printf("   ");
      }
      }
      printf("\n");
      }
getch();
}

Leave a Reply

Your email address will not be published. Required fields are marked *


× How can I help you?