0

Code error

If i run this #include <iostream> using namespace std; int main() { int a=5; int b=2; float sum =a/b; cout<<sum; return 0; } The output comes 2,but 5/2 isn't 2,it's 2.5!

5th Oct 2020, 5:09 PM
Titi Yuri
Titi Yuri - avatar
2 Answers
0
Now what should i do for a double output
6th Oct 2020, 5:04 AM
Titi Yuri
Titi Yuri - avatar