diff --git a/Neeraj_Bhatt_1901013/Q1-Out.PNG b/Neeraj_Bhatt_1901013/Q1-Out.PNG new file mode 100644 index 0000000..71d13ae Binary files /dev/null and b/Neeraj_Bhatt_1901013/Q1-Out.PNG differ diff --git a/Neeraj_Bhatt_1901013/Q1-program.c b/Neeraj_Bhatt_1901013/Q1-program.c new file mode 100644 index 0000000..4ec03d7 --- /dev/null +++ b/Neeraj_Bhatt_1901013/Q1-program.c @@ -0,0 +1,14 @@ +#include +#include +void main() +{ + int gd=DETECT,gm; + initgraph (&gd,&gm,"c:\\tc\\bgi"); + setcolor(2); + printf("Before transalation\n\n\n\n\n\n"); + line(50,70,190,40); + line(60,79,200,66); + printf("After transalation"); + getch(); + closegraph(); +} \ No newline at end of file diff --git a/Neeraj_Bhatt_1901013/Q2-out.PNG b/Neeraj_Bhatt_1901013/Q2-out.PNG new file mode 100644 index 0000000..dd4e418 Binary files /dev/null and b/Neeraj_Bhatt_1901013/Q2-out.PNG differ diff --git a/Neeraj_Bhatt_1901013/Q2-program.c b/Neeraj_Bhatt_1901013/Q2-program.c new file mode 100644 index 0000000..76e138e --- /dev/null +++ b/Neeraj_Bhatt_1901013/Q2-program.c @@ -0,0 +1,36 @@ +#include +#include +#include +void main() +{ + intgd = DETECT ,gm, i; + float x, y,dx,dy,steps; + int x0, x1, y0, y1; + initgraph(&gd, &gm, "C:\\TC\\BGI"); + setbkcolor(WHITE); + x0 = 100 , y0 = 200, x1 = 500, y1 = 300; + dx = (float)(x1 - x0); + dy = (float)(y1 - y0); + if(dx>=dy) + { + steps = dx; + } + else + { + steps = dy; + } + dx = dx/steps; + dy = dy/steps; + x = x0; + y = y0; + i = 1; + while(i<= steps) + { + putpixel(x, y, RED); + x += dx; + y += dy; + i=i+1; + } + getch(); + closegraph(); +} \ No newline at end of file diff --git a/Neeraj_Bhatt_1901013/demo b/Neeraj_Bhatt_1901013/demo new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/Neeraj_Bhatt_1901013/demo @@ -0,0 +1 @@ +