Please Comment, Subscribe and Click Bell🔔🔔🔔 Icon for More Updates. To learn software course from our experts please register here for online training: @t
Sir,as different compilers uses different method for solving this equation.so we student are confusing right now because our answer is not matching with your answer...yet you are right in solving this..but then also we are not getting so make a video to tell us difference of compiler to compiler...and which one is valid method to solve this equation.....plz reply sir.....
In today's compiler the concept used by sir is not used..... modern IDE includes ATOM,CODE BLOCK which uses GCC COMPILER and they have entirely different concept to solve this problem IF U WANT TO LEARN THAT CONCEPT I WILL recommend you to go through this youtube channel they have modern concept and easy way for understanding whole concept ruclips.net/video/yRt-zYFJIvE/видео.html
Sir, I think there is a problem in calculation. When I calculated myself I got 19, 9. And after compiling I got the same as output from my machine. Would you please explain?
Same here. I am using Code Blocks 20.03. But there are two warning messages : warning: operation on 'a' may be undefined [-Wsequence-point]| warning: operation on 'b' may be undefined [-Wsequence-point]|
int a=4, b=5; b = a++ + a--; a = ++b + b--; b = 4(now a=5 bcoz post inc) + 5( now a=4 bcoz post dec) So now b = 4+5=9 and now b value is 9 not 5 a = 10(now b=10 bcoz pre inc) + 10(now b =9 bcoz post dec) So last updated value of b = 9 And a = 10 + 10 = 20
hello sir from my prespective i think sir this is the wrong explanation first increment and decrement operation then addition I think this make sence Turbo c compiler ans is : 18,8 gcc compiler ans is : 19,9 output is depend on your compiler (software)
This type of expression always evaluted from right to left .So,the ans is.... 2 1 1 U also visit the link : www.c4learn.com/c-programming/increment-operator-inside-printf/
The value comes 19 and 9 becz of the order of evaluation and also due to the cause of no any sequence point in the first expression to evaluate b.. b undergoes evaluation like this: As post increment and post decrement are of same precendence hence b=4+5=9 First in a++ the value of a is substituted and then it gets incremented and after that in a-- value of incremented 'a' is substituted and then it undergoes decrement by 1 Hence result comes 9
Hello , using Code:blocks and the OP: of the program is :19,9 Can you please give us a feedback why we are getting diffrent results? P.S kepp up the good work :) !
stupid answer . The actual answer is that modify operators have higher precedence than airthematic . so first whole expression is evaluated for modify operators then value is subsituted and then the expression is evaluated
In today's compiler the concept used by sir is not used..... modern IDE includes ATOM,CODE BLOCK which uses GCC COMPILER and they have entirely different concept to solve this problem IF U WANT TO LEARN THAT CONCEPT I WILL recommend you to go through this youtube channel they have modern concept and easy way for understanding whole concept ruclips.net/video/yRt-zYFJIvE/видео.html
int i=5; printf("%d %d ", i, i=i++) ; printf ("%d ", i); i=i++; printf ("%d ", i); I am getting output as 5 5 5 6 Why there is no change inside printf statement but outside printf there is a change!!! I compiled this in turbo C compiler
i++ ---> 1)old value is assigned 2) then increment is done ++i--> 1)value is incremented 2)new value is assigned. Ex:- #include int main() { int a=5; printf("%d",a++); printf("%d",a); printf("%d",++a); printf("%d",a); } The output of your code will be 5 6 7 7 There is no point of assigning i=i++ because both output will be same. Hope you understand
Please Comment, Subscribe and Click Bell🔔🔔🔔 Icon for More Updates. To learn software course from our experts please register here for online training: @t
Sir answer is 9 and 19
sir output on "vs code" and "code block" is 19 and 9 but "blue & black" on output is 18 and 8 . pls explain.....
wrong answer
Sir, in first expression a = 4 and b = 9. And second expression a = 19 and b = 9.
Sir you have gone wrong here. Answer for a = 19 and b = 9.
Turbo c compiler ans is : 18,8
gcc compiler ans is : 19,9
output is depend on your compiler (software)
right bro..
@@rahuljathar9429 ggc compiler dusra method use karta hai solve k lie? or yadi hai to bata do bhae kaise , mujhe samjh nae a rhi problem.
In turbo c++ 18 and 8
check with changing a-- by a no change occur
Turbo c compiler ans is : 18,8
gcc compiler ans is : 19,9
output is depend on your compiler (software)
Thank u bro, you clarified my doubt
sir your answer is wrong :
#include
int main(void) {
int a=4,b=5;
b = a++ + a--;
a= ++b+b--;
printf("%d %d
",a,b);
}
this is giving me a = 20,b = 9
Right
Crystal clear concept 🙏
Sir,as different compilers uses different method for solving this equation.so we student are confusing right now because our answer is not matching with your answer...yet you are right in solving this..but then also we are not getting so make a video to tell us difference of compiler to compiler...and which one is valid method to solve this equation.....plz reply sir.....
In today's compiler the concept used by sir is not used..... modern IDE includes ATOM,CODE BLOCK which uses GCC COMPILER and they have entirely different concept to solve this problem IF U WANT TO LEARN THAT CONCEPT I WILL recommend
you to go through this youtube channel they have modern concept and easy way for understanding whole concept ruclips.net/video/yRt-zYFJIvE/видео.html
Sir, I think there is a problem in calculation. When I calculated myself I got 19, 9. And after compiling I got the same as output from my machine. Would you please explain?
yes, the same case happening at my side too.
Which compiler do you use?
@@atom7004
Which compiler do you use?
Same here. I am using Code Blocks 20.03. But there are two warning messages :
warning: operation on 'a' may be undefined [-Wsequence-point]|
warning: operation on 'b' may be undefined [-Wsequence-point]|
That's the only place where I learnt a lot.... Tysm sir
Superb sir 🙏🙏
Thank u 🙏 sir..!?
I got result as same result of you nice one tq
Thanks sir you are fabolous fantastic stunning
int a=4, b=5;
b = a++ + a--;
a = ++b + b--;
b = 4(now a=5 bcoz post inc)
+ 5( now a=4 bcoz post dec)
So now b = 4+5=9 and now b value is 9 not 5
a = 10(now b=10 bcoz pre inc)
+ 10(now b =9 bcoz post dec)
So last updated value of b = 9
And a = 10 + 10 = 20
exactly
..
Right 👍,I got same ans
thanks a lot sir...
Thankyou sir
I compiled it also in Dev C Apllication..
Output is. " 19 9".
Guys make sure it
99.9% user wrong answer in this comment and also teacher also wrong and 0.1% user corect answer is 20,9
Thank you
super sir.
Sir please discuss more equation with the combination of both increment and decrement operator on the same line of equation
i=4;
j= ++i*i++;
i calculated by your method j=25 but compiler giving j=30.
help!!!!
thats y u must always use best compiler...
Same 😢
thnx .
hello sir from my prespective i think sir this is the wrong explanation first increment and decrement operation then addition I think this make sence
Turbo c compiler ans is : 18,8
gcc compiler ans is : 19,9
output is depend on your compiler (software)
Sir its wrong actually ans is a=19,b=9
main()
{
int z, x=5, y=-10, a=4, b=2;
z=x++ - --y * --b / a;
printf("%d ",z);
}
Output will be 7, how?
this method is wrong for solving expression
Please tell me Right Ans. Process
@@akshaymdeshmukh764 refer codechamp channel bro you will get
@@saitejateegala2986 I got it from codechamp somedays before. Thank you Sai...
According to Turbo C++ Version 3.0,
Output: a = 18, b = 8
a value is 19, b is 9
It depends on compiler
Hi op comes 19 9 please upload again
Sir please verify , Is this right ?
I wrote the same code and got O/P 20 and 9
It depends on compiler also...not same output for different compiler
I got too
Hi Sir. Can you explain how it will print 5 here.
V1=2, V2;
V2=V1++ + V1++;
printf("%d", v2) ;
1. step) left v1++ = 2, v1 = 3
2. step) right v1++ = 3, v1 = 4
3. step) v2 = v1++ + v1++ = 2 + 3 = 5, v1 = 4
V1 is 2 here . So use it in equation the change it into 3...So, 2+3=5 is the value of V2 and value of V1 is 4
Wrong,final value should be a=19 & b=9
You are also wrong
He is completly wrong
Its output is a=20; b=9; i executed in jdk
#include
int main()
{
int i = 1;
printf("%d %d %d
", i++, i++, i);
return 0;
}
sir wat is d output of this
2,1,3
could you please explain?
Shifa Sultana 1,2,3
211
This type of expression always evaluted from right to left .So,the ans is.... 2 1 1
U also visit the link : www.c4learn.com/c-programming/increment-operator-inside-printf/
Hi Sir,
I wrote this program in C and it gave me a result of 19, 9. Can anyone explain?
Thanks
same
It depend on compiler....
The value comes 19 and 9 becz of the order of evaluation and also due to the cause of no any sequence point in the first expression to evaluate b..
b undergoes evaluation like this:
As post increment and post decrement are of same precendence hence
b=4+5=9
First in a++ the value of a is substituted and then it gets incremented and after that in a-- value of incremented 'a' is substituted and then it undergoes decrement by 1 Hence result comes 9
@@mdnizamraza7939 a comes out to be 20
I think correct answer is a=11 and b=9....
Ans is wrong ,it is 19,9 in both 32 bit and 64 bit compiler
dammn my compiler is showing a =19 and b = 9 ; am i wrong dude?
Hello , using Code:blocks and the OP: of the program is :19,9
Can you please give us a feedback why we are getting diffrent results?
P.S kepp up the good work :) !
its because of the compiler different compiler gives different lexical values based on the tokens generated by the threads
stupid answer . The actual answer is that modify operators have higher precedence than airthematic . so first whole expression is evaluated for modify operators then value is subsituted and then the expression is evaluated
In today's compiler the concept used by sir is not used..... modern IDE includes ATOM,CODE BLOCK which uses GCC COMPILER and they have entirely different concept to solve this problem IF U WANT TO LEARN THAT CONCEPT I WILL recommend
you to go through this youtube channel they have modern concept and easy way for understanding whole concept ruclips.net/video/yRt-zYFJIvE/видео.html
@@lawn_mower4941
this is ok all discusion
Hi sir,
Can you please Execute and let me know the answer
sir ,answer is wrong!
answer is 19 and 9 sir u went wrong
Turbo c compiler ans is : 18,8
gcc compiler ans is : 19,9
output is depend on your compiler (software)
i got the answer 19,9
Yes
Same
Sir answer is 9 and 19
Solving with right method, we get 20,9 answer
Brother, according to mingw and gcc compiler a = 19 b = 9.
Solving with right method, the answer is 19,9
No follow the concept of increment operators and do it properly, u will get output as 20,9
int i=5;
printf("%d %d
", i, i=i++) ;
printf ("%d
", i);
i=i++;
printf ("%d
", i);
I am getting output as
5 5
5
6
Why there is no change inside printf statement but outside printf there is a change!!!
I compiled this in turbo C compiler
Try by storing i++ in another variable then there will be change
i++ ---> 1)old value is assigned 2) then increment is done
++i--> 1)value is incremented 2)new value is assigned.
Ex:-
#include
int main()
{
int a=5;
printf("%d",a++);
printf("%d",a);
printf("%d",++a);
printf("%d",a);
}
The output of your code will be
5
6
7
7
There is no point of assigning i=i++ because both output will be same.
Hope you understand
*Output:* 20, 9
19,9
Turbo c
compiler ans is : 18,8
gcc compiler ans is : 19,9
output is depend on your compiler (software)
@@murgan4307bro don't follow the compiler, follow the concept of increment operators and do it properly, u will get the output as 20,9
99.9% user wrong answer in this comment and also teacher also wrong and 0.1% user corect answer is 20,9
Video visual clarity ledu ra
Answer is wrong !! ...wrong explanation
Output is 20 and 9.
Sir u have done wrong please cross check once
19 , 9 only boss
Anna b=9
Why answer becomes 19 9 why +1
The answer must be 9,20 .
Output is 19,9 , i will give better explanation then you
You are also wrong right answer is 20,9 and first you understand operator concept rule
galat padhaane se acha plzz dont upload videos i tried solving,, method hi glat hai
Listen all java is better than c
And you listen python is better than java
@@softwarefoodiee na not yet listened 😒
22
Hindi me translation
Bsdk galat hai
prgram gave 19 9 as output
in first step i.e, b=(a++)+(a--)
b=(4)+(5)=9
after taking a++ as 4 its an post increment so for a-- we get 5
@@durgavarshith9596 how is a = 19 and not 20?
18, 8 is correct answer