Sie sind auf Seite 1von 2

AIM:

To write a c program using graphics to draw a circuit.


ALGORITHM:
Step 1: start.
Step 2: include the graphics header file.
Step 3: get the inputs.
Step 4: give the comments of the program as required.
Step 5: stop.
SOURCE CODE:
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
/*GRAPHICS*/
void main()
{
int gdriver=DETECT,gmode;
initgraph(&gdriver,&gmode,"");
clrscr();
line(100,130,120,130);
line(105,135,115,135);
line(110,130,110,70);
line(110,70,170,70);
line(170,80,170,70);
line(170,70,170,60);
line(170,60,200,70);
line(170,80,200,70);
line(200,80,200,60);
line(200,70,260,70);
line(260,70,260,120);
line(260,120,270,125);
line(270,125,260,130);
line(260,130,270,135);

line(270,135,260,140);
line(260,140,270,145);
line(270,145,260,150);
line(260,150,260,200);
line(260,200,110,200);
line(110,200,110,135);
outtextxy(160,60,"A");
outtextxy(210,60,"C");
outtextxy(280,130,"R");
outtextxy(110,50,"DIODE IN FORWARD BIAS");
getch();
}

Das könnte Ihnen auch gefallen