closed by
279 views
0 votes
0 votes
closed as a duplicate of: Undefined Behaviour in C
what is the ouput of this code ?

main()

{

int x = 10;

int y = (++x) + (--x);

printf(“%d”,y);

}

 

and i am confuse about this code specifically about this expression int y = (++x) + (--x);

so if this expression is wrong so what the wrong about this expression and topic related to “Precedence and associativity”
closed by

Related questions

0 votes
0 votes
2 answers
2
Debargha Mitra Roy asked Apr 10
179 views
What is the output of the below code?#include <stdio.h void main() { static int var = 5; printf("%d ", var ); if (var) main(); }a. 1 2 3 4 5b. 1c. 5 4 3 2 1d. Error
3 votes
3 votes
3 answers
3
Laxman Ghanchi asked May 19, 2023
1,205 views
#include<stdio.h void print(int n) { printf("Hello "); if(n++ == 0) return ; print(n); n++; } int main() { void print(); print(-4); }How many times printf execute?? And H...
0 votes
0 votes
1 answer
4
Laxman Ghanchi asked May 19, 2023
714 views
#include<stdio.h>void print(int n){ printf("Hello "); if(n++ == 0) return ; print(n); n++;}int main(){ void print(); print(-4);}