i am getting infinity in my program !!! ??

This is a discussion on i am getting infinity in my program !!! ?? within the C++ Programming forums, part of the General Programming Boards category; this is what i am suppose to do.:
Scan two doubles a and b (a<b).
Integrate numerically y=0.5*cos^2(x)+0.25 from x=a ...

i am getting infinity in my program !!! ??

this is what i am suppose to do.:Scan two doubles a and b (a<b).
Integrate numerically y=0.5*cos^2(x)+0.25 from x=a to x=b.

Use two do/while statements to continue the
calculations for different n_trap and different a and b. For
example, use ask=1 to continue calculations for different n_term
within the inner do/while loop, and ask=0 to exit that loop.
Use flag=1 to continue calculations for different a and b
within the outer do/while loop, and flag=0 to exit that loop.

and this is my program so far. btw im only doing the first part havent tried the flag part because im confused