Operators
- What will be the output of the following C code?
#include <stdio.h>
void main()
{
int num = 0;
if (num = 0)
{
printf("It's zero\n");
}
else
{
printf("It's not zero\n");
}
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
It's not zero
- What will be the output of the following C code?
#include <stdio.h>
int main()
{
int n = 5;
if (n & (n = 6))
printf("True %d\n", n);
else
printf("False %d\n", n);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: E
True 6
- What will be the output of the following C code?
#include <stdio.h>
int main()
{
int p = 3;
if (4 |(p = 4))
printf("p is %d\n", p);
else
printf("%d\n", p);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: E
p is 4
- What will be the output of the following C code?
#include <stdio.h>
int main()
{
int n = -7;
if (!0 == 1)
printf("Yes\n");
else
printf("No\n");
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
Yes
- What will be the output of the following C code?
#include <stdio.h>
int main()
{
if (~2 == 3)
{
printf("Yes\n");
}
else
{
printf("No\n");
}
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: E
No