Advertisement
zoro-10

3A. Draw the following basic shapes in the center of the screen

Apr 1st, 2024
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.55 KB | None | 0 0
  1. //(i)Circle
  2. //(ii)Rectangle
  3. //(iii)Square
  4. //(iv)Concentric circles
  5. //(v)Ellipse
  6. //(vi)Line
  7.  
  8. #include<graphics.h>
  9. #include<stdio.h>
  10. #include<conio.h>
  11. void main()
  12. {
  13. int gd=DETECT,gm,x,y;
  14. initgraph(&gd,&gm,"C:\\TurboC3\\BGI");
  15. x=getmaxx();
  16. y=getmaxy();
  17. circle(x/2,y/2,15);
  18. rectangle(275,204,363,273);
  19. rectangle(x/2-20,y/2-20,x/2+20,y/2+20);
  20. ellipse(x/2,y/2,0,360,40,30);
  21. circle(x/2,y/2,60);
  22. circle(x/2,y/2,70);
  23. circle(x/2,y/2,80);
  24. circle(x/2,y/2,90);
  25. circle(x/2,y/2,100);
  26. line(0,y/2,x,y/2);
  27. line(x/2,0,x/2,y);
  28. getch();
  29. closegraph();
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement