+ 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.

4th Oct 2018, 12:33 AM
Jaskirat Singh
Jaskirat Singh - avatar
2 Respostas
+ 7
int n=3,f float f=(float)n;
4th Oct 2018, 5:19 AM
Coder
Coder - avatar
+ 3
Cast it using this syntax: (final type)expression; Eg : int num = 5; float res = (float)num;
4th Oct 2018, 12:36 AM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar