What will be the output of the following C code?
#include <stdio.h>
int main()
{
int i = 3;
int l = i / -2;
int k = i % -2;
printf("%d %d\n", l, k);
return 0;
}
What is the precedence of arithmetic operators (from highest to lowest)?
1 Crore+ students have signed up on EduRev. Have you? Download the App |
What will be the output of the following C code?
#include <stdio.h>
void main()
{
int x = 1, y = 0, z = 5;
int a = x && y && z++;
printf("%d", z);
}
Do logical operators in the C language are evaluated with the short circuit?
What will be the output of the following C code?
#include <stdio.h>
int main()
{
int i = 10;
int *p = &i;
printf("%d\n", *p++);
}
What will be the output of this program on an implementation where int occupies 2 bytes?
What will be the output of the following C code?
#include <stdio.h>
void main()
{
int k = 8;
int x = 0 == 1 && k++;
printf("%d%d\n", x, k);
}
What will be the value of the following assignment expression?
(x = foo())!= 1 considering foo() returns 2
What will be the output of the following C code?
#include <stdio.h>
void main()
{
int x = 5.3 % 2;
printf("Value of x is %d", x);
}
What will be the output of the following C code?
#include <stdio.h>
int main()
{
int a = 10;
double b = 5.6;
int c;
c = a + b;
printf("%d", c);
}
What will be the final value of j in the following C code?
#include <stdio.h>
int main()
{
int i = 0, j = 0;
if (i && (j = i + 10))
//do something
;
}
Which among the following is NOT a logical or relational operator?
What will be the output of the following C code?
#include <stdio.h>
int main()
{
int i = 0;
int j = i++ + i;
printf("%d\n", j);
}
What will be the output of the following C code?
#include <stdio.h>
void main()
{
int a = 5, b = -7, c = 0, d;
d = ++a && ++b || ++c;
printf("\n%d%d%d%d", a, b, c, d);
}
10 videos|13 docs|15 tests
|
10 videos|13 docs|15 tests
|