+ 2
Conditional
Why not equal? https://code.sololearn.com/c5228cnu3BbA/?ref=app
4 Réponses
+ 3
Try this.
#include <stdio.h>
int main() {
float f1=0.1;
if(f1==0.1f)
printf ("Equal\n");
else
printf ("Not equal\n");
return 0;
}
+ 1
Use 0.1f or double f1
0
Try this!
#include <stdio.h>
int main() {
float f1 = 0.1;
if (f1 == (float) 0.1)
printf("Equal\n");
else
printf("Not equal\n");
return 0;
}