what is the output of the following C code ??
#include <studio.h>
int main()
{
int X= 1;
if (X= =0)
if (X> =0)
printed("false\n");
else
Printf ("false\n")
return 0;
}
a) true
b) false
c) depands on computer
d) No print statement
Answers
Answered by
1
Answer:
No print statement
@user died
Answered by
8
#include <stdio.h>
int main()
{
float f = 0.1;
if (f == 0.1)
printf("True");
else
printf("False");
return 0;
}
The output is false.
#include <stdio.h>
int main()
{
float f = 0.1;
if (f == (float)0.1)
printf("True");
else
printf("False");
return 0;
}
Now shows the correct output. Whats the reason behind this?
Also what is the reason of this behavior.
#include <stdio.h>
main()
{
int n = 0, m = 0;
if (n > 0)
if (m > 0)
printf("True");
else
printf("False");
}
Similar questions