- #1
martusa
- 3
- 0
- Homework Statement
- Draw a circle inside a square
- Relevant Equations
- figures c+*
i only managed to draw a square and don’t know how to put circle pattern inside of it
C:
#include <stdio.h>
int main()
{
int totalrowcol;
printf("Enter the number of rows: ");
scanf_s("%d", &totalrowcol);
for (int rowno = 1; rowno <= totalrowcol; rowno++)
{
for (int colno = 1; colno <= totalrowcol; colno++)
{
if ((colno==1)|| (colno==totalrowcol)||
(rowno==1)||(rowno==totalrowcol)||
())
{
printf("* ");
}
else {
printf(" ");
}
}
printf("\n");
}
return 0;
}
Last edited by a moderator: