The function ftoa uses the same static buffer for every call. Hence, it would contain the latest conversion result. You can declare two separate buffers for minimum and maximum. After calling ftoa, you can copy the ftoa buffer to the buffer you have declared for minimum and maximum,
Thank you for the reply Sampath.
I am a novice at coding and stuff. Can you tell me as to how to declare and use different buffers for the ftoa command ?
You can declare buffers like this
// Copy ftoa buffer to the declared buffers.
pResult1 = ftoa(temp1,&iStatus1);
pResult2 = ftoa(temp1,&iStatus2);