What is the best way in C to convert a number to a string? Improve Improve Improve Like Article Like Save Article Save Share Report issue Report Solution: Use sprintf() function. #include<stdio.h> int main() { char result[50]; float num = 23.34; sprintf(result, "%f", num); printf("\n The string for the num is %s", result); getchar(); } You can also write your own function using ASCII values of numbers. Last Updated : 02 Jun, 2017 Like Article Save Article Previous C Float and Double Next How will you show memory representation of C variables? Share your thoughts in the comments Add Your Comment Please Login to comment...