Graphics C Program
Graphics C Program
float x = X0;
float y = Y0;
getch(); // Wait for user input before closing the graphics window
closegraph();
return 0;
}
int dx = x2 - x1;
int dy = y2 - y1;
int i1 = 2 * dy;
int d = i1 - dx;
int xend;
if (dx < 0) {
x = x2;
y = y2;
xend = x1;
} else {
x = x1;
y = y1;
xend = x2;
}
printf("(%d, %d)\n", x, y);
if (d < 0) {
d += i1;
} else {
d += i2;
y++;
x++;
int main() {
return 0;
int main() {
int gd = DETECT, gm;
int xc = 200, yc = 200, r = 100;
return 0;
}
#include <stdio.h>
#include <graphics.h>
while (x > y) {
y++;
if (P <= 0) {
P = P + 2*y + 1;
} else {
x--;
P = P + 2*y - 2*x + 1;
}
return 0;
}