C Program to Draw Capacitor using Graphics Function

C Program to Draw Capacitor using Graphics Function.



C Program to Draw Capacitor using Graphics Function Images-Pictures-Pics-Photos- Basic C Programs-C Language Programs-C Program to draw a Capacitor in Graphics Mode-General C Programs-Program for Capacitor-Capacitor Program-Graphics Programs.

InitGraph initializes the graphics system by loading a graphics driver from disk then putting the system into graphics mode

closegraph( ) function switches back the screen from graphics mode to text mode.

outtextxy(x,y,"Capacitor");

It is similar to printf statement. Prints text on a screen in Text Mode while outtextxy( ) function prints Text onto screen in Graphics Mode. This function accepts 3 parameters.

X Co-ordinate - Specifies X Co-ordinate

Y Co-ordinate - Specifies Y Co-ordinate

Text - String/Text to be printed on the specified Co-ordinates.

--------------------------------------------------------------------------------------------------------------------------

#include<stdio.h>
#include<conio.h>
#include<graphics.h>
void main( )
{
    int gd = DETECT, gm;
    initgraph(&gd, &gm, "c:\\tc\\bgi");
    outtextxy(110,60,"Capacitor");
    line(80,100,100,100);
    line(100,80,100,120);
    line(120,80,120,120);
    line(120,100,140,100);
    getch( );
    closegraph( );
}

--------------------------------------------------------------------------------------------------------

Output

--------------------------------------------------------------------------------------------------------------------------

Displays the Capacitor




EmoticonEmoticon