Convert A Floating Point Number To String in C
Convert A Floating Point Number To String in C
Example:
A simple way is to use sprintf(), but use of standard library functions for direct conversion is not allowed.
Approach: The idea is to separate integral and fractional parts and convert them to strings separately. Following are the detailed steps.
Output:
"233.0070"
Note: The program performs similar operation if instead of oat, a double type is taken.