Answers for "c language convert float to string"

C
0

c float to string

#include <stdio.h>
int main()
{
   float f = 1.123456789;
   char c[50]; //size of the number
    sprintf(c, "%g", f);
    printf(c);
    printf("n");
}
Posted by: Guest on March-18-2021
0

c convert float to string

#include <stdio.h>
int main()
{
   float f = 1000;
   char c[50]; //size of the number
    sprintf(c, "%g", f);
    printf(c);
    printf("n");
}
Posted by: Guest on March-18-2021

Code answers related to "C"

Browse Popular Code Answers by Language