//Program to Draw Bar
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
void main()
{
int gd=DETECT,gm;
int a,b,c,d,e;
int i,j;
int x=150,y=390;
initgraph(&gd,&gm,"C:\\TurboC3\\BGI");
line(150,20,150,400);
line(140,390,450,390);
circle(x,y,3);
for(i=0;i<=350;i=i+20)
for(j=0;j<=220;j=j+10)
{
line(148+j,370-i,152+j,370-i);
}
outtextxy(x-22,y-23,"20");
outtextxy(x-22,y-43,"40");
outtextxy(x-22,y-63,"60");
outtextxy(x-22,y-83,"80");
outtextxy(x-28,y-103,"100");
outtextxy(x-28,y-123,"120");
outtextxy(x-28,y-143,"140");
outtextxy(x-28,y-163,"160");
outtextxy(x-28,y-183,"180");
outtextxy(x-28,y-203,"200");
outtextxy(x-28,y-223,"220");
outtextxy(x-28,y-243,"240");
outtextxy(x-28,y-263,"260");
outtextxy(x-28,y-283,"280");
outtextxy(x-28,y-303,"300");
outtextxy(x-28,y-323,"320");
outtextxy(x-28,y-343,"340");
outtextxy(x-28,y-363,"360");
printf("Enter any\n5 values\n");
scanf("%d%d%d%d%d",&a,&b,&c,&d,&e);
setfillstyle(2,2);
bar(170,390-a,190,390);
setfillstyle(2,3);
bar(210,390-b,230,390);
setfillstyle(2,4);
bar(250,390-c,270,390);
setfillstyle(2,5);
bar(290,390-d,310,390);
setfillstyle(2,6);
bar(330,390-e,350,390);
getch();
closegraph();
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.