/*************************************************************\
This example is well orgainzed, all the beginning and end of
loops and function are aligned, it is very easy to see where
is the beginning and end of a loop even there is no statement
to show where it is.
\*************************************************************/
#include <stdio.h>

double   pn;
double   p;
int          count1;
int          count2;
double   f(double);
double   f1(double);
double   a;
double   b;
double   xn;
double   temp;
double   left;
double   lefty;
double   right;
double   righty;

void main()
{
a = 0;
b = 0;
printf ("\nPoint a = ");
scanf("%lf", &a) ;
printf ("\nPoint b = ");
scanf("%lf", &b) ;
printf ("\n");
left       =   a;
right     =   b;
pn        =   (left+right)/2;

{
lefty  =  f(left);
righty =  f(right);

{
left = pn;
}
{
right = pn;
}

pn        = (left+right)/2;
count1++;
}

xn        = pn;

{
temp    = xn-(f(xn)/f1(xn));
xn        = temp;
count2++;
}

printf ( " N = %.8d pn = %.8f\n" , count1, pn);
printf ( " K = %.8d xk = %.8f\n\n" , count2, xn);
}

double f(double lnn)
{