Is it possible to print a rectangle in c without using grahics.h?
not a good answer, but though u can try this for fun: int t = 8,i,j; for(i=0;i<8;i++) printf("_"); printf("\n"); for(i=0;i<8;i++) { printf("|"); for(j=1;j<7;j++) printf(" "); printf("|\n"); } for(i=0;i<8;i++) printf("-"); printf("\n");
yes. Maybe not that neat though.
Thank you as83! With your help I ended up with this: int i; for(i=0;i<8;i++) printf("_"); printf("\n"); for(i=0;i<8;i++) { printf("|"); printf("\t"); printf("|\n"); } for(i=0;i<8;i++) printf("-"); I was having a problem printing the two vertical sides of the rectangle!
welcome :)
Join our real-time social learning platform and learn together with your friends!