Sunday, January 1, 2012

A C long double variable question? Strange output? Help!!!?

Your while loop checks for accu to be less than or equal to zero, but you ask for positive numbers when inputting it. Thereofre, the loop never executes and you get the garbage data that was in the double halfpi as the answer. There are probably other errors (like how you never change the value of accu), but that's the most obvious one.

No comments:

Post a Comment