Generate shape of letter D

Write a program to generate the shape of letter D


#include<stdio.h>
#include<conio.h>
#include<graphics.h>
void main()
{
	int gd=DETECT,gm,x,y,r=100;
	initgraph(&gd,&gm,"c:\\tc\\bgi");
	printf("\nEnter the coordinates to draw the 'D' : ");
	scanf("%d %d",&x,&y);
	arc(x,(y+r),270,90,r);
	arc(x,(y+r),260,100,r+20);
	line(x,y,x,y+(2*r));
	line(x-20,y-20,x-20,y+(2*r)+20);
	setfillstyle(1,YELLOW);
	floodfill(x-1,y-1,WHITE);
	getch();
}


Output
1

Leave a Reply

Your email address will not be published. Required fields are marked *