Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*This programme is done using graphics.h and is exclusively done using turbo c++ ide
- this is the code for the 1st output seen in the page
- working :
- for loop is used for animation of movement of the circle and the ellipse
- ellipse function used for eyes and circle for head as well as eye balls
- arc function used for displaying the mouth of the smiley
- delay function used for decreasing the speed of simulation of the animated drawing
- */
- #include<conio.h>
- #include<graphics.h>
- #include<stdio.h>
- #include<stdlib.h>
- #include<dos.h>
- void main()
- {
- int gdriver=DETECT,gmode;
- initgraph(&gdriver,&gmode,"C:\\TC\\bgi");
- /* setcolor(YELLOW);
- for(int i=1;i<=200;i++)//for right triangle 3d effect
- {
- line(i,300,200,i);
- delay(10);
- }*/
- // setcolor(RED);
- for(int i=1;i<=360;i++)
- {
- arc(400,250,0,i,210);//THE FACE MAIN PART
- setcolor(CYAN);
- ellipse(300,200,0,i,100,40);
- circle(300,200,30);//THE FIRST EYE
- ellipse(500,200,0,i,100,40);//THE SECOND EYE ELLIPSE 2
- setcolor(CYAN);
- setcolor(CYAN);
- circle(500,200,30);//THE SECOND EYE
- arc(400,300,180,360,100); //THE MOUTH
- delay(10);
- }
- getch();
- closegraph();
- }
Advertisement
Add Comment
Please, Sign In to add comment