Solution: Use sprintf() function.
#include<stdio.h> int main() { char result[50]; float num = 23.34; sprintf (result, "%f" , num); printf ( "
The string for the num is %s" , result); getchar (); } |
You can also write your own function using ASCII values of numbers.
leave a comment
0 Comments