===========================================================================
CODING
#include<all.h>
void main()
{
int vertex,x1,x2,x,y,i,j,A,B,C,i1,i2,h,k,r,y1,y2;
float D;
first();
second();
first();
clrscr();
cprintf(" (x-h)ý+ (y-k)ý= rý\r\n\r\n Enter:-\r\n H= ");
cscanf("%d",&h);
cprintf("\r\n K= ");
cscanf("%d",&k);
cprintf("\r\n R= ");
cscanf("%d",&r);
clrscr();
for(i=-11,x=7,y=12;i<=11;x=x+3,i++)
{
if(i==-11)
{
gotoxy(x+2,y);
cprintf("®");
}
else if(i==11)
{
gotoxy(x,y);
cprintf("¯");
}
else
{
gotoxy(x,y);
cprintf("ÄÂÄ");
gotoxy(x,y+1);
if(i==0);
else if(i>0 && i<10)
cprintf(" %d",i);
else
cprintf("%d",i);
}
}
for(i=11,x=39,y=1;i>=-11;i--,y++)
{
gotoxy(x,y);
if(i==-11)
cprintf(" ");
else if(i==11)
cprintf(" ");
else
{
if(i==0)
cprintf("");
else if(i>0 && i<10)
cprintf(" %d",i);
else if(i==-10)
cprintf("\b%d",i);
else
cprintf("%d",i);
gotoxy(x+2,y);
if(i==0)
cprintf("Å");
else
cprintf("´");
}
}
textcolor(10+BLINK);
for(i=h-r;i<=h+r;i++)
{
D=sqrt(pow(r,2)-pow(i-h,2));
if(D==(int)D)
{
y1=D+k;
y2=-D+k;
x1=i;
x1=41+3*x1;
y1=12-y1;
y2=12-y2;
gotoxy(x1,y1);
cprintf("þ");
gotoxy(x1,y2);
cprintf("þ");
}
}
getch();
getch();
}
CODING
#include<all.h>
void main()
{
int vertex,x1,x2,x,y,i,j,A,B,C,i1,i2,h,k,r,y1,y2;
float D;
first();
second();
first();
clrscr();
cprintf(" (x-h)ý+ (y-k)ý= rý\r\n\r\n Enter:-\r\n H= ");
cscanf("%d",&h);
cprintf("\r\n K= ");
cscanf("%d",&k);
cprintf("\r\n R= ");
cscanf("%d",&r);
clrscr();
for(i=-11,x=7,y=12;i<=11;x=x+3,i++)
{
if(i==-11)
{
gotoxy(x+2,y);
cprintf("®");
}
else if(i==11)
{
gotoxy(x,y);
cprintf("¯");
}
else
{
gotoxy(x,y);
cprintf("ÄÂÄ");
gotoxy(x,y+1);
if(i==0);
else if(i>0 && i<10)
cprintf(" %d",i);
else
cprintf("%d",i);
}
}
for(i=11,x=39,y=1;i>=-11;i--,y++)
{
gotoxy(x,y);
if(i==-11)
cprintf(" ");
else if(i==11)
cprintf(" ");
else
{
if(i==0)
cprintf("");
else if(i>0 && i<10)
cprintf(" %d",i);
else if(i==-10)
cprintf("\b%d",i);
else
cprintf("%d",i);
gotoxy(x+2,y);
if(i==0)
cprintf("Å");
else
cprintf("´");
}
}
textcolor(10+BLINK);
for(i=h-r;i<=h+r;i++)
{
D=sqrt(pow(r,2)-pow(i-h,2));
if(D==(int)D)
{
y1=D+k;
y2=-D+k;
x1=i;
x1=41+3*x1;
y1=12-y1;
y2=12-y2;
gotoxy(x1,y1);
cprintf("þ");
gotoxy(x1,y2);
cprintf("þ");
}
}
getch();
getch();
}
===========================================================================
No comments:
Post a Comment