0

Please any one help me by explaining code, how (0.7>a) in these code.

#include <stdio.h> int main() { float a=0.7; if(0.7>a) printf ("hi"); else printf ("hello"); return 0; }

3rd May 2020, 5:46 PM
I.S. Patil
I.S. Patil - avatar
1 Antwort
+ 1
Any decimal value by default is considered as double and has higher precision than float. In your case 'a' is of type float and 0.7 is a double. Hope this answers the question.
3rd May 2020, 6:12 PM
Avinesh
Avinesh - avatar