%ch2demofun.m
clear
%bisection method between [2.5,3.5]
%a = 2.5;
%b = 3.5;
a = input ('enter lower limit')
b = input ('enter upper limit')
tol = 1.E-6;
while ((b-a)>tol)
   m = (a+b)/2;
   if (sign(demfun1(a))==sign(demfun1(m)))
      a = m;
   else
      b = m;
   end
   fprintf('\na= %f b= %f f(a)=%E f(b)=%E',a,b,demfun1(a),demfun1(b))
end
