Advertisement
Guest User

Untitled

a guest
Dec 18th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. #include<graphics.h>
  2.  
  3. int main()
  4. {
  5. int gd=DETECT,gm;
  6. initgraph(&gd,&gm,"C:\\TC\\BGI");
  7.  
  8.  
  9. int x=getmaxx();//get maximum value for x co-ordinate
  10. int y=getmaxy();//get maximum value for y co-ordinate
  11.  
  12. setfillstyle(1,YELLOW);
  13. fillellipse(x/2,y/2,70,70);//fill the ellipse with color(face)
  14.  
  15. setfillstyle(1,BLACK);
  16. fillellipse(x/2-30,y/2-25,10,12);//fill the ellipse with color (eye)
  17. fillellipse(x/2+30,y/2-25,10,12);//fill the ellipse with color (eye)
  18.  
  19. setcolor(BLACK);
  20. line(x/2,2-10,x/2,y/2+20);//draw a line(nose)
  21.  
  22. arc(x/2,y/2,220,320,50);//draw arc(mouth)
  23.  
  24.  
  25. getch();
  26. closegraph();//close graphic mode
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement