Hi all, I'm using float for the first time and am running into trouble.
Here's a snapshot of the code:
1 2 3 4 5 6
float fl = 1.00;
cout << fl;
int a = 10;
int b = 5;
fl = b/a;
cout << fl;
The output is "1 \ 0" when I am expecting "1.00 \ 0.50". Please let me know where I went wrong. I was not able to find a good example of basic input combined with basic calculation on the forum. Thank you!