+ 2
Number to floating point
How to convert a number to floating point in c language? Can someone help me with the code? I just need the algorithm. I can figure out the code.
2 Réponses
+ 7
int n=3,f
float f=(float)n;
+ 3
Cast it using this syntax:
(final type)expression;
Eg :
int num = 5;
float res = (float)num;