0% found this document useful (0 votes)
19 views

To Write A C' Program Using Graphics To Draw A Circuit

This C program uses graphics functions to draw an electrical circuit diagram. It includes graphics header files, gets user inputs, and draws the circuit using line and text functions. Key elements of the circuit like resistors, diodes, and connections are represented. The program initializes graphics mode, clears the screen, draws the circuit elements, and waits for user input before ending.

Uploaded by

Ponmalar Sivaraj
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

To Write A C' Program Using Graphics To Draw A Circuit

This C program uses graphics functions to draw an electrical circuit diagram. It includes graphics header files, gets user inputs, and draws the circuit using line and text functions. Key elements of the circuit like resistors, diodes, and connections are represented. The program initializes graphics mode, clears the screen, draws the circuit elements, and waits for user input before ending.

Uploaded by

Ponmalar Sivaraj
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 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();
}

You might also like