Code:

#pragma windows 500000,500000
#include <stdio.h>
#include <math.h>
#include<dbos\graphics.h>
#include<windows.h>
float gap, u;
int w0, w1, w2, w3, b0, b1, b2, b3, x0, x1, x2, x3, y0, y1, y2, y3, c;
int a=300,b=300;
int x[100], y[100];
int draw()
{
x[0]= x0;
y[0]= y0;
c=1;
u=1/100;
gap=u;
do
{
b0=pow((1-u),3);
b1=3*pow((1-u),2)*u;
b2=3*(1-u)*pow(u,2);
b3=pow(u,3);
x[c]=((b0*w0*x0)+(b1*w1*x1)+(b2*w2*x2)+(b3*w3*x3))/((b0*w0)+(b1*w1)+(b2*w2)+(b3*w3));
y[c]=((b0*w0*y0)+(b1*w1*y1)+(b2*w2*y2)+(b3*w3*y3))/((b0*w0)+(b1*w1)+(b2*w2)+(b3*w3));
c=c+1;
u=u+gap;
}
while (u<=1);
draw_bezier (x,y,100,RED);
return 1;
}
int main()
{
int hand;
winio("%gr[grey]&", a, b);
winio("%lw&",&hand);
winio("x0: %rd\t&",&x0);
winio("x1: %rd\t&",&x1);
winio("x2: %rd\t&",&x2);
winio("x3: %rd\n&",&x3);
winio("y0: %rd\t&",&y0);
winio("y1: %rd\t&",&y1);
winio("y2: %rd\t&",&y2);
winio("y3: %rd\n&",&y3);
winio("w0: %rd\t&",&w0);
winio("w1: %rd\t&",&w1);
winio("w2: %rd\t&",&w2);
winio("w3: %rd\n&",&w3);
winio("%bc[red]%`^bt[Draw]\t",draw);
}