1.
What is the output of the following C code:
#include <stdio.h>
void main()
{
int x = 12;
int *p = &x;
int *k = p++;
int r = p - k;
printf("%d", r);
}
2.
What is the output of the following C code:
#include <stdio.h>
void main()
{
int a = -5;
int k = (a++, ++a);
printf("%d
", k);
}
3.
What is the output of the following C code:
#include <stdio.h>
int main()
{
int x = 8;
int y = x == 1 ? getchar():5;
printf("%d
", y);
}
4.
What is the output of the following C code:
#include <stdio.h>
int main()
{
int x = 2, y = 0;
int z = (y++) ? ++y == 1 && x : 2;
printf("%d
", z);
return 0;
}
5.
What is the output of the following C code:
#include <stdio.h>

void main()
{
int k = -1;
int m = 7;
k < m ? k = k + 1 : m = m + 1;
printf("%d", k);
}
6.
What is the output of the following C code:
#include <stdio.h>
int main()
{
int x = 9, y = 10;
int z;
z = (y++, y--);
printf("%d
", z--);
return 0;
}
7.
What is the output of the following C code:
#include

int main() {
    int x = 5, y = 1;
    int z = (y++) ? 2 : y == 1 && x || y;
    printf("%d
", --z);
    return 0;
}
8.
What is the output of the following C code:
#include
int main() {
    int a = 1, b = 2, c = -1, d = 4, e;
    e = c + d = b * a;
    printf("%d, %d
", e, d);
}
9.
What is the output of the following C code:
#include
void main() {
    double b = 3 % 0 * 1 - 4 / 2;
    printf("%lf", b);
}
10.
What is the output of the following C code:
#include
int main() {
    int p = 10, q = 20, r;
    if (r = p = 5 || q > 20)
        printf("%d", r);
    else
        printf("No Output
");
}