English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

double b =0.1;
int a;
a = 10 * b;

2007-03-10 00:52:27 · 2 answers · asked by Anonymous in Computers & Internet Programming & Design

2 answers

just type cast the double. you'll lose all the numbers behind the decimal.

a=(int) (10*b);

2007-03-10 01:41:53 · answer #1 · answered by jytopy 4 · 0 0

Write a = (int)(10 * b);

2007-03-10 01:00:23 · answer #2 · answered by Andy T 7 · 0 1

fedest.com, questions and answers