Showing posts with label Computer Graphics programs. Show all posts
Showing posts with label Computer Graphics programs. Show all posts

Thursday, 28 March 2013

C program for Bubble coming out of a bottle

Program: Bubble coming out of a bottle.
Language : C

Computer Graphics
#include<stdio.h>
#include<math.h>
#include<conio.h>
#include<graphics.h>
void main()
{
int i;
int gd=DETECT,gmode;
initgraph(&gd,&gmode,"");
for(i=0;i<300;i+=5)
{
    ellipse(300,400,0,360,50,10);
    line(250,400,250,275);
    line(350,400,350,275);
    ellipse(300,200,0,360,20,5);
    line(280,240,280,200);

C program for Analog Clock

#include<graphics.h>
#include<conio.h>
#include<math.h>
#include<dos.h>
void main()
{
int gd=DETECT,gm;
int x=320,y=240,r=200,i,h,m,s,thetamin,thetasec;
struct  time t;
char n[12][3]={"3","2","1","12","11","10","9","8","7","6","5","4"};
initgraph(&gd,&gm,"c:\bin\tc");//put the directory which containsegavga.bgi
circle(x,y,220);
setcolor(4);
settextstyle(4,0,5);
for(i=0;i<12;i++)
{
if(i!=3)