Posts

Showing posts from March, 2025

CGAAAAAAAAAAAAND

1a]Study and enlist the basic functions used for graphics in  C/C++/Python language. Give an example for each of them. #include<graphics.h> #include<stdio.h> #include<conio.h> void main() { int gd=DETECT,gm; initgraph(&gd,&gm, "C:\\TurboC3\\bgi"); line (100,100,200,200); getch(); closegraph(); }   1b]Draw a co-ordinate axis at the center of the screen. #include <stdio.h> #include <conio.h> #include <graphics.h> void main() {  int gd = DETECT, gm;  int midx, middy;  initgraph(&gd, &gm, "C:\\TURBOC3\\BGI");  cleardevice();  midx = getmaxx() / 2;  midy = getmaxy() / 2;  line(1, midy, getmaxx(), midy);  line(midx, 1, midx, getmaxy());  getch();  closegraph(); } 3]Draw the following basic shapes in the center of the screen: i) Circle ii) Rectangle iii) Square iv) Concentric Circles v)Ellipsevi) Line #include <graphics.h> #include <conio.h> void main() { int gd = D...