+ 1

Plz ans i m so much confused 😕 😕

#include <stdio.h> int main() { int x, y, z; z = 3; printf("x=%d",x); x = z+(--x); /* assign 3 to x, then decrement z to 2 */ printf("x=%d \n", x); y = 3; x = ++y; /* increment y to 4, then assign 4 to x */ printf("x=%d \n", x); printf("y=%d \n", y); printf("z=%d\n",z); return 0; }

20th Oct 2019, 4:21 AM
Mr. Khan
Mr. Khan - avatar
7 Respostas
+ 3
Mr. Khan the code does not look right. E.g. no value for x has been assigned but you are using it in the first printf.
20th Oct 2019, 5:41 AM
Sonic
Sonic - avatar
+ 4
When you write x = z + (--x) you are first decrementing x, adding it to z and assigning this sum back to x and not what you claim to do in the comments.
20th Oct 2019, 5:45 AM
Sonic
Sonic - avatar
+ 3
Mr. Khan check the tutorial again. I get the feeling that you are mixing up some variables.
20th Oct 2019, 5:47 AM
Sonic
Sonic - avatar
+ 2
MirielleđŸ¶ [Inactive] thanks for the mention.
20th Oct 2019, 5:39 AM
Sonic
Sonic - avatar
+ 2
It's confusing bro đŸ€ŁđŸ˜‚đŸ˜‚đŸ˜…đŸ˜…đŸ˜…
20th Oct 2019, 12:31 PM
Rishu Dubey
Rishu Dubey - avatar
+ 1
Sonic but its in tutorial one i ve just started leaning it thats y m little confused how x=4 is taking from downward x to the upward x .... As it cant be done anyways
20th Oct 2019, 5:45 AM
Mr. Khan
Mr. Khan - avatar
+ 1
Ohk thanks
20th Oct 2019, 5:48 AM
Mr. Khan
Mr. Khan - avatar