/
operator divide numerator by denominator.
4/2=2
5/2=2 (due to both operands are integral type)
you can also get exact result by using type casting:-
(float)5/2=2.5
(float)a/2=depends on the value of `a`
so , don't forget to initialise the variable a
. if it is of type auto
then it will contain garbage value(if you don't initialise).
i think that now you don't have problem with this issue but if you have some more problems on it, then don't be hesitate to create new thread with appropriate title and ask you problem there(I am also a c++ Beginner).