Posts

Showing posts from January, 2018

A program to Initialize Mouse and display its cursor.

/* This is program to Initialise Mouse and display its cursor.*/ #include<stdio.h> #include<dos.h> void main() { union REGS i,o; i.x.ax=1; int86(0x33,&i,&o); getch(); }

A program To Create a Clock

#include<conio.h> #include<graphics.h> #include<math.h> #include<dos.h> #define WBC 5 //^watchbackcolor #define X 200 #define Y 200 void dial(int x, int y); void sechand(int timeminute); void minhand(int t) { int x1,y1; setlinestyle(0,0,3); x1= X+ (80 * cos(t*0.1047)); y1= Y+ (80 * sin(t*0.1047)); setcolor(BLACK); line( X, Y, x1, y1); setcolor(WBC+1); line( X, Y, X+ 80 * cos((t-1)*0.1047),Y+ 80 * sin((t-1)*0.1047)); circle(X,Y,4); } void sechand(int t) { int x1,y1; setlinestyle(0,0,3); x1= X+(100 * cos(t*0.1047)); y1= Y+(100 * sin(t*0.1047)); setcolor(RED); line(X, Y, x1, y1); setcolor(WBC+1); line(X, Y, X+ 100 * cos((t-1)*0.1047),Y+ 100 * sin((t-1)*0.1047)); circle(X,Y,4); } void dial(int x,int y) { int const size=200; setfillstyle(1,WBC); fillellipse(x,y,size,size); setfillstyle(1,WBC+1); fillellipse(x,y,size-20,size-20); outtextxy(x,y-(size-40),"12"); outtextxy(x,y+(size-40),"6"); ...

A Program To Create a Circle

#include <graphics.h> #include <stdlib.h> #include <stdio.h> #include <conio.h> int main(void) {    /* request auto detection */    int gdriver = DETECT, gmode, errorcode;    int midx, midy;    int radius = 100;    /* initialize graphics and local variables */    initgraph(&gdriver, &gmode, "C:\\TC\\bgi");    /* read result of initialization */    errorcode = graphresult();    if (errorcode != grOk)  /* an error occurred */    {       printf("Graphics error: %s\n", grapherrormsg(errorcode));       printf("Press any key to halt:");       getch();       exit(1); /* terminate with an error code */    }    midx = getmaxx() / 2;    midy = getmaxy() / 2;    setcolor(getmaxcolor());    /* draw the circle */    ...

A program to create Rainbow

Image
#include<stdio.h> #include<conio.h> #include<graphics.h> #include<dos.h> #include<snap.h> void main() { int gdriver = DETECT,gmode; int x,y,i; initgraph(&gdriver,&gmode,"C:\\TC\\BGI"); x=getmaxx()/2; y=getmaxy()/2; for(i=30;i<200;i++) { delay(100); setcolor(i/10); arc(x,y,0,180,i-10); } capture("C:\\TC\\Capture\\Capture1.jpg"); getch(); }