+ 1
Why is float x= 11/100 ; in c++ only showing 0 ?
C++ question
2 odpowiedzi
+ 5
11 and 100 are both integers. Dividing 2 integers will have an integer as result.
You could try
float x = (float)11/100;
or
float x = 11/100.0;
so at least one of the numbers is a decimal number.
+ 4
11 divisable by 100 zero times. ...
int/int result int value only.. .