closed by
405 views
0 votes
0 votes
closed as a duplicate of: Undefined Behaviour in C
#include<stdio.h>
int main()
{
    char a[]={'A','B','C','D'};
    char *p=&a[0];
    *p++;
    printf("%c%c",*++p,--*p);
}

What will be the output?

1)C B

2)B B

3)B A

4)C A

closed by

Related questions

0 votes
0 votes
0 answers
1
srestha asked Mar 7, 2018
611 views
#include<stdio.h int fun1(int x) { x=14; } int fun2(int x) { x=20; } int main() { int(*p)(),m,n; scanf("%d",&m); if(m) p=fun1; else p=fun2; n=(*p)(); printf("%d",n); retu...
0 votes
0 votes
1 answer
2
Parshu gate asked Nov 27, 2017
641 views
main( ){double x, d = 5.0;int y ;x = d * (x = 2.5/d);printf(“x=%lf\n”,x);x = d*(y=(int)2.5+1.5);printf("x=%lf y=%d\n",x,y);}What is output of above program?
0 votes
0 votes
1 answer
3
Parshu gate asked Nov 19, 2017
376 views
#include<stdio.h>int main(){ int a=2;if(a==2){ a=~a+2<<1; printf("%d",a);}}