Answers for "converting float int string in c"

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

int to float c

float percentage;
percentage = (float)number/total * 100;
Posted by: Guest on November-25-2020

Code answers related to "C"

Browse Popular Code Answers by Language