Documente Academic
Documente Profesional
Documente Cultură
h>
#include<stdlib.h>
#include<math.h>
main()
char ch[20];
float i;
scanf("%[^\n]", ch);
//gets//
i = my_a2f(ch);
}
float my_a2f(char *p)
// here i took another two variables for counting the number of digits in mantissa
//
if (p[i] == '.')
pnt_seen = i;
break;
if (i < pnt_seen)
else if (i == pnt_seen)
else
num2 = num2 * 10 + (p[i] - 48);// after dot convert string into value//
++x;
//
y = y * (pow(10,x));
f2 = num2 / (float) y;
f3 = num + f2;
return f3;