1. ## Draw circle

Can anybody tell me how to draw a circle without floating point numbers?

2. Code:
```#include <stdio.h>

int main(void)
{
puts(" XX");
puts("X  X");
puts(" XX");

return 0;
}
itsme@itsme:~/C\$ ./circle
XX
X  X
XX```

3. Radius can change dynamically.. -

4. Told that, It may not be perfect circle. But given a radius, how do you draw circle?

5. Code:
```#include <stdio.h>

int main(void)
{
int radius = 10;  /* value 1 through screen_width/2 */
int i;

putchar('X');
putchar('\n');

return 0;
}```
Looking at a circle from a 90 degree angle...

6. PHP Code:
``` #include <stdio.h> int main (void) {   int radius = 10;   int x, y;   for (y = -radius; y <= radius; y++)   {     for (x = -radius; x <= radius; x++)     {       if (x * x + y * y <= radius * radius)         putchar ('X');       else         putchar (' ');     }     putchar ('\n');   }   return 0; }  ```

7. I think, this looks better. Thanks Moi

Code:
```#include <stdio.h>

int main (void)
{
int x, y;

{
{
if ( (x * x + y * y <= ( (radius * radius)+1) ) && ( x * x + y * y >= (radius * radius) -1 ))
putchar ('X');
else
putchar (' ');
}
putchar ('\n');
}
return 0;
}```

PHP Code:
```               XXX     X           X   X               X X                   X X                   X X                   X   X               X     X           X          XXX  ```

8. I wrote an OpenGL clock demo that uses Bressenhams line and circle algorithms. You can find it here:

Line/Circle algos (clock demo)