This is my code for calculating pi. My professor asked that the program's loops end when 3.14,3.141, and 3.1415 appear for the first time, no matter the decimals after the ones asked for. The problem is that it stops at 3.141 two n terms after it actually reaches it the first time, and when it reaches 3.1415 appears it is numerous n terms after the first time it appears as well. Any suggestions to fix this? Is the optimization needed in the condition or in the actual variable declarations? Any suggestions will be appreciated. Written in C Language.