+ 1

Why it was not showing the desired output ?

float f = 0.5; if ( f == 0.5 ) printf("Equal"); else printf("Not Equal"); Output : Not Equal Why it was not showing the output "Equal" ?

25th Jun 2020, 10:40 AM
Jeevan Chandra Joshi
Jeevan Chandra Joshi - avatar
3 odpowiedzi
0
Isn't 0.5==0.5? Or c works other way?
25th Jun 2020, 10:45 AM
Abhay
Abhay - avatar
0
Why it shows Not equal , The control never reaches else block since if condition will always be true . So your code outputs only Equal
25th Jun 2020, 10:46 AM
uday kiran
uday kiran - avatar