I made a program that inputs the radius of a circle, and then should output a circle of asterisks. however, I am just getting the fourth-quadrant part of the circle, and I need the whole circle to be printout. what do I need in my code?
this is my code:
#include <stdio.h>
#define x 25
int main()
{
char A[x][x];
int r, i, j;
printf("Radius: ");
scanf("%d", &r);
for(i=0; i<=r; i++)
{
for(j=0; j<=r; j++)
{
if(i*i + j*j <= r*r)
A[j]= '*'
else
A[j]= ' ';
}
}
for(i=o; i<=r; i++)
{
for(j=o; j<=r; j++)
printf("%c", A[j]);
printf("\n");
}
return 0;
}