In this section, you will learn to convert an integer type data into a float. The following programs helps you in converting an integer into a float type data.
This program takes an integer number at console and it converts into a float type data using the toString() method. This method specified the string value signed an integer which is converted into a float format.
toString(): This method converts an integer into a float and returns a float object.
Here is the code of this program:
Output this program.
Enter a integer value!
Posted on: July 4, 2007 If you enjoyed this post then why not add us on Google+? Add us to your Circles