Search Here

C program to draw Upper Case Alphabets (7-Segment style)


/* C program to draw A - Z */

#include<graphics.h>
int main()
{
    int gd = DETECT,gm;
 
    //initgraph(&gd, &gm, "C:\\TC\\BGI"); /* For Windows Turbo-C users */
    initgraph(&gd,&gm,NULL); /* For Linux users */
    setbkcolor(WHITE); setcolor(BLACK);
    
    /* Block to draw A */
    line(312,117,162,441);
    line(312,117,438,441);
    line(225,306,384,306);
    delay(10000); cleardevice();
    
    /* Block to draw B */
    line(200,70,200,370);
    ellipse(200,145,270,90,90,75);
    ellipse(200,295,270,90,90,75);
    delay(10000); cleardevice();
    
    /* Block to draw C */
    ellipse(320,240,90,270,90,140);
    delay(10000); cleardevice();
    
    /* Block to draw D */
    line(200,70,200,370);
    ellipse(200,220,270,90,120,150);
    delay(10000); cleardevice();
    
    /* Block to draw E */
    line(200,70,200,380);
    line(200,70,380,70);
    line(200,220,350,220);
    line(200,380,380,380);
    delay(10000); cleardevice();
    
    /* Block to draw F */
    line(200,70,200,380);
    line(200,70,380,70);
    line(200,220,350,220);
    delay(10000); cleardevice();
    
    /* Block to draw G */
    ellipse(320,240,90,270,90,140);
    line(320,240,320,380);
    line(320,240,380,240);
    line(380,240,380,380);
    delay(10000); cleardevice();
    
    /* Block to draw H */
    line(200,70,200,380);
    line(380,70,380,380);
    line(200,220,380,220);
    delay(10000); cleardevice();
    
    /* Block to draw I */
    line(200,70,200,380);
    line(195,70,205,70);
    line(195,380,205,380);
    delay(10000); cleardevice();
    
    /* Block to draw J */
    line(200,70,200,380);
    line(195,70,205,70);
    ellipse(150,380,0,180,50,30);
    delay(10000); cleardevice();
    
    /* Block to draw K */
    line(200,70,200,380);
    line(200,225,380,70);
    line(200,225,380,380);
    delay(10000); cleardevice();
    
    /* Block to draw L */
    line(200,70,200,380);
    line(200,380,380,380);
    delay(10000); cleardevice();
    
    /* Block to draw M */
    line(200,70,200,380);
    line(200,70,300,220);
    line(300,220,400,70);
    line(400,70,400,380);
    delay(10000); cleardevice();
    
    /* Block to draw N */
    line(200,70,200,380);
    line(380,70,380,380);
    line(200,70,380,380);
    delay(10000); cleardevice();
    
    /* Block to draw O */
    ellipse(320,240,0,360,190,200);
    delay(10000); cleardevice();
    
    /* Block to draw P */
    line(200,70,200,370);
    ellipse(200,145,270,90,90,75);
    delay(10000); cleardevice();
    
    /* Block to draw Q */
    ellipse(320,240,0,360,180,190);
    line(400,380,450,460);
    delay(10000); cleardevice();
    
    /* Block to draw R */
    line(200,70,200,370);
    ellipse(200,145,270,90,90,75);
    line(200,220,330,370);
    delay(10000); cleardevice();
    
    /* Block to draw S */
    ellipse(200,145,90,270,90,75);
    ellipse(200,295,270,90,90,75);
    delay(10000); cleardevice();
    
    /* Block to draw T */
    line(290,70,290,380);
    line(200,70,380,70);
    delay(10000); cleardevice();
    
    /* Block to draw U */
    ellipse(320,100,360,180,100,250);
    delay(10000); cleardevice();
    
    /* Block to draw V */
    line(200,70,290,380);
    line(380,70,290,380);
    delay(10000); cleardevice();
    
    /* Block to draw W */
    line(140,110,200,330);
    line(270,160,200,330);
    line(270,160,330,330);
    line(390,110,330,330);
    delay(10000); cleardevice();
    
    /* Block to draw X */
    line(200,70,380,380);
    line(380,70,200,380);
    delay(10000); cleardevice();
    
    /* Block to draw Y */
    line(170,100,285,230);
    line(400,100,285,230);
    line(285,230,285,400);
    delay(10000); cleardevice();
    
    /* Block to draw Z */
    line(200,70,380,70);
    line(200,380,380,380);
    line(380,70,200,380);
    delay(10000); cleardevice();
    
    closegraph();
    system("clear");
    return 0;
}


C program to draw all Upper Case Alphabets
Output

C program to draw all Upper Case Alphabets
Output

No comments:

Post a Comment