#include #include #include #include #define PATHTODRIVER "D:\\TC\\BGI\\" long double f1(long double x) { int i; int n; long double temp; long double f; const k=100; temp=(long double)x/1; f=(long double)x/1; n=1; for (i=1; i=0)) {x0=0; l=50; b=480; w=700; h=478;} else if ((x1y2) y2=y; x+=dx; } while (x<=x2); my = h/fabs(y2-y1); mx = w/fabs(x2-x1); y0=b-abs(y1*my); x=x1; do {y=f1(x); putpixel(x0+x*mx,y0-y*my,15); x+=dx; } while (x<=x2); } void main(void) {float x1,x2; int gdriver = DETECT; int gmode; int errorcode; initgraph(&gdriver,&gmode,PATHTODRIVER); errorcode = graphresult(); printf("Enter x1 (diapozon x1 OT -40 DO +41): "); scanf("%f",&x1); printf("Enter x2 (diapozon x2 OT -40 DO +41): "); scanf("%f",&x2); cleardevice(); if (errorcode == grOk) { grafik(x1,x2); getch(); closegraph(); } else { printf("Error: %d\n",errorcode); getch(); } }