Recent questions tagged undefined-behaviour

1 votes
2 answers
2
#include<stdio.h int main() { int x, y = 7; x = ++y + ++y + y ; printf("%d\n", x); return 0; }What is the output of this code snippet ?A. 27B. 26C. 25D. Compilation error...
1 votes
2 answers
7
0 votes
1 answer
8
#include<stdio.h int main() { char *p1="xyz"; char *p2="xyz"; if(p1==p2) printf("equal"); else printf("unequal"); }Output is equal how??? please explain
1 votes
1 answer
9
#include<stdio.h>int main(){int a = 10, b = 20, c = 30, d = 40;printf("%d%d%d",a, b, c);printf("%d%d%d", d);return 0;}What is the Output and when I run it I am getting so...
2 votes
1 answer
10
#include<stdio.h #include<stdlib.h int main() { int p=9; printf("%d %d",p++,++p); } how it executed and also how printf function executed left to right or right to left?
1 votes
1 answer
11
#include<stdio.h #define CUBE(x) (x*x*x) int main() { int a, b=3; a = CUBE(b++); printf("%d, %d ", a, b); return 0; }Why this give 27,6 as output?
21 votes
1 answer
12
What will be the output of the following code?#include<stdio.h int main() { int x=10, y; y = (x++) + (++x); printf("%d %d %d %d ", y, x++, x, ++x); }22,10,11,1322,11,11,1...
13 votes
8 answers
13
If n has 3, then the statement a[++n]=n++;assigns 3 to a[5]assigns 4 to a[5]assigns 4 to a[4]what is assigned is compiler dependent
0 votes
4 answers
14
To see more, click for the full list of questions or popular tags.