Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Neeraj_Bhatt_1901013/Q1-Out.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions Neeraj_Bhatt_1901013/Q1-program.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include<graphics.h>
#include<conio.h>
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();
}
Binary file added Neeraj_Bhatt_1901013/Q2-out.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions Neeraj_Bhatt_1901013/Q2-program.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#include<graphics.h>
#include<conio.h>
#include<stdio.h>
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();
}
1 change: 1 addition & 0 deletions Neeraj_Bhatt_1901013/demo
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@