کد:
int driver=DETECT,mode=0;
initgraph(&driver,&mode,"");
و اما قسمت آخر یعنی mode* :
کد:
#include "graphics.h"
#include "iostream.h"
#include "conio.h"
#include "math.h"
void main()
{
clrscr();
int x,y,x1,y1,a,b,c,gd=DETECT,gm;
cout<<"Please enter a , b and c from ax^2 + bx + c = 0 equation : "<<endl;
cout<<"a = ";
cin>>a;
cout<<"b = ";
cin>>b;
cout<<"c = ";
cin>>c;
initgraph(&gd,&gm,"");
line(0,240,639,240);
line(320,0,320,479);
x=0;
y=c;
setcolor(2);
for(x1=1;y1<480,y1>0;x1++)
{
y1=a*pow(x1,2)+b*x1+c;
line(320+x,240-y,320+x1,240-y1);
line(320-x,240-y,320-x1,240-y1);
x=x1;
y=y1;
}
getch();
}
اگر برنامه اشکال رو درست رسم نمی کرد به خودم پیغام خصوصی بدین.