By using type conversion add 2 float numbers but the result must be integer | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

By using type conversion add 2 float numbers but the result must be integer

18th Apr 2020, 4:01 PM
Tejaswini Alavala
Tejaswini Alavala - avatar
4 Answers
+ 5
It would be great if you can tell us the language you want to know. To finally get an integer needs also some more information from you. What version you like to use: 4.49 -> 4 or 5 4.51 -> 4 or 5
18th Apr 2020, 4:51 PM
Lothar
Lothar - avatar
+ 1
Use round()
18th Apr 2020, 4:08 PM
Bharath nayak
Bharath nayak - avatar
+ 1
You are likely going to get one Int This 2.56 : 2 or 3 Else 10 .61 : 11 or 10
18th Apr 2020, 6:41 PM
Uzochukwu Emmanuel
Uzochukwu Emmanuel - avatar
0
Tag language also in which you are looking.. In python, int() cast to Integer result. Ex: s=int(4.0+5.0) =>s=9
19th Apr 2020, 6:38 AM
Jayakrishna 🇮🇳