int main() {
int a=10;
cout << (5/9) * a <<endl;
return 0;
}
Why does this show answer as 0 and not the correct answer
This is because, ( 5/9 ) which is 0.55 , it is taken as integer and it will be 0, and anything multiplied by 0 gives 0, thts why u are getting zero,
For correct answer , explicitly write float before 5/9;
1 Like