answersLogoWhite

0

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;

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

How to convert hexadecimal into decimal and print it on screen in assembly language value 1b convert it into decimal?

1B base 16 = 27 base10


Is a decimal integer?

A decimal number can be an integer. All that decimal means is that the place value of each digit is ten times that of the digit to its right.


What is the integer value of 6.3?

6.3 is a decimal number, not an integer. Rounding it to the nearest integer will give 6.


What term describes a value with no decimal or fraction?

An integer


Is -35 An Integer?

No, to be an integer a number must not have a decimal value.


How do you write the value of a decimal?

You first write the integer part, then write the decimal point and then the fractional part in decimal form.


How do you convert a negative decimal to a fraction?

Convert the absolute value of the decimal to a fraction and then put a minus sign before it.


If you moving the decimal point to the right we are moving from And the value to be?

A value to its multiple by a positive integer power of 10.


How do you make 15 a decimal?

The value (magnitude) of integer number 15 is the same as the real (decimal) number 15.0


If we are moving the decimal point to the right we are moving from a what value to a what value?

To another value which is a multiple of 10k in which k is a positive integer.


Is 9 an integer?

s.. 9 is an integer but 9.a23 or any other decimal value isn't integerYes.


What is the general rule for multiplying a decimal by a negative integer power of 10?

The decimal point is moved to the left by the value of the power.