answersLogoWhite

0


Best Answer

Sure especially in programming. Generally an int can be passed directly into a float.

Examples:

9 is an integer

9.00 is a float

in programming

int A = 9;

Float B = A;

User Avatar

Wiki User

16y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

Most (all?) programming languages support automatic built-in conversion of this type, at the loss of the factional part. Following is a simple example in C:

void example(float f) {

int i = f;

...

}

If you call example(3.1415), i will have value 3.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you convert integer to float?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What happens when java program attempts to divide one integer by another?

In that case, unless you specifically convert ("cast") at least one of the numbers to a double or float, the result will also be an integer. Example: 1 / 3 = 0


What is the difference between integer numbers and float numbers?

Integer numbers : ...-5,-4,-3,-2,-1,0,1,2,3,4,5... Float numbers 1.25, 1.26 etc They are float numbers because its value can be altered after the point, which is based on an integer number.


How do you convert Temperature 950000000 to integer?

You cannot convert temperature to number; 950000000 is already an integer.


Can an float value be assigned to int variable?

Yes, an integer can be assigned as a float value.But it get stored as a float value, that is an implicit type conversion occurs during compilation.Smaller data types are convertible to larger data types.eg:float b=12;// an integer constant is assigned to a float variableprintf("%f",b);// when printing b it will print as 12.000000


How convert integer to float using switch case in c?

The switch/case statement in the c language is defined by the language specification to use an int value, so you can not use a float value. You can, however, convert the float into an int and use it, so long as the resulting values and functionality meet your functional requirements.


How do you convert an integer to a fraction?

Any integer can be expressed as a fraction with the numerator equal to the integer and the denominator equal to 1.


Can an integer be 3 and a half?

No, an integer cannot contain a decimal place. Instead consider using a double or a float for decimals.


How do you convert integer to IPv6?

poo on your self and then you will convert integer to ipv6! jokes! fart on your self then you will be able to convert! and i am serious! to find the real answer give me your number we'll have something private


What is the code required to convert an integer variable to a string variable in Java?

There are several different methods to convert an integer variable to a string variable in Java. For example, one can use the following code to convert an integer variable to a string variable: Integer.toString(number)


What does float in ict mean?

A float is basically any number that isn't an integer, so it's basically a number with a decimal place.


What is a function used to convert ASCII to integer?

atoi


How do you convert the decimal to integer value in C language?

Use an implicit or explicit cast. Since integers are whole numbers, the decimal portion will be truncated. Example in C: float f; int i; f = 1.5; i = f; // i = 1.0 Example in C++: float f = 1.5; int i = ( int ) f;