+ 1
if c=float a/int b, should i declare c as float or int?
4 Respostas
+ 5
It depends of what you want it to be. You can declare c as both but as @Cool Codin said, the type of a/b will be float so if c is int, the result will be rounded
+ 2
You should declare 'c' as 'float' as float a will force convert int b to float, this is called type casting.
😊😊
+ 1
okayy thank u 😊