C++ and floats | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 2

C++ and floats

What should I #include in order to print a float?

12th Apr 2022, 3:28 AM
Meshack Msengelwa
4 Answers
+ 1
Do you mean print a float like float a=7.5; cout<<a; or something different ?
12th Apr 2022, 5:02 AM
Vicent Roxan
Vicent Roxan - avatar
+ 1
Yes but i have an equation y/2. Y is 11 in this example and its printing an int
12th Apr 2022, 6:40 PM
Meshack Msengelwa
+ 1
I figured it out. Lol y is an integer
12th Apr 2022, 6:43 PM
Meshack Msengelwa
+ 1
Meshack Msengelwa Nothing needed to include in order to use float numbers in C++
14th Apr 2022, 2:47 AM
Ilyas Bakirov
Ilyas Bakirov - avatar