Metode Secant Dengan Bahasa C++

LISTING PROGRAM
#include<stdio.h>;
#include<conio.h>;
#include<math.h>;

/*x0 = harga awal
x1 = harga kedua
tol = toleransi
max_iter = jumlah iterasi maksimum */

float x0, x1, tol;
int max_iter;
float f(float x)
{
return 4*x*x - x - 5;
}

void main ()
{
int it;
float epsilon, xb;
printf("METODE SECANT");
printf("\n\n\n");
printf("Soal\n");
printf("Akar Persamaan y=3*x*x - 2*x - 5 \n\n\n");
printf("Masukan Nilai a : "); scanf("%f",&x0);
printf("Masukan Nilai b : ");scanf("%f",&x1);
printf("Masukan Nilai Toleransi : ");scanf("%f",&tol);
printf("Jumlah Iterasi Maksimum : ");scanf("%d",&max_iter);

it = 0;
printf("\n");
printf(" I x f(x) epsilon\n");
printf("\n");

do
{
it = it +1;
xb = x1 - f(x1)*(x1 - x0) / (f(x1) - f(x0));
epsilon = fabs(xb-x0);
printf("%3d %8.5f %8.5f %8.2e\n",it, xb, f(xb), epsilon);
printf("\n");
x0 = x1;
x1 = xb;

}
while(it <= max_iter && epsilon > tol);
if(it <= max_iter)
{
printf("\n");
printf("Toleransi terpenuhi\n\n");
printf("Hasil akhir=%g\n",xb);
printf("\n");

}

else
printf("Toleransi tidak terpenuhi\n");
getch();
}